CDT-Powershell Feb 2010 - SMTP Port 25

abashedwhimsicalΛογισμικό & κατασκευή λογ/κού

2 Νοε 2013 (πριν από 4 χρόνια και 12 μέρες)

90 εμφανίσεις


What is Powershell?


Why Powershell?


What is new in Powershell 2.0?


Advanced Functions


Modules


Remoting


Eventing


Background Jobs


Power Shell ISE


Transactions


Language changes



100+ new cmdlets



PowerShell is an object
-
oriented programming language and interactive
command line shell for Microsoft Windows


Built and Integrated with .NET Framework


Included in Windows Server
®

2008 R2 and Windows
®

7


Its is basically to IT guys to
automate system tasks


It uses cmdlets, it’s a small .net classes


Easily composed


Create higher level tools for complex operations


Provides a common management automation platform


Powershell

What is Powershell ?


IT Pros want a powerful way to manage datacenters


Designed to reduce the cost and effort required to manage your IT
infrastructure


Reduces time
-
to
-
results


Traditional Windows Shell is text based and parsing is nightmare


Designed to help standardize and automate all of your management
processes


Easy to adopt, easy to learn, and easy to use


Click and manage will not scale


End
-
to
-
end manageability across server roles


Active Directory®, Exchange, Group Policy, etc.


Reusability


Extensibility



What is new in PowerShell 2.0?



Advanced Functions


Modules


Remoting


Eventing


Background Jobs


Improved Help


PowerShell ISE


Transactions


New Operators


100+ new cmdlets



Modules are self contained reusable code, It contain single function or


multiple function which is independent to itself



Modules are Next Version of Snap in




Require some manual efforts to create modules



Get
-
Module


Import
-
Module


New
-
Module


Remove
-
Module




Advanced Functions provide help, parameter tab
-
completion, and cmdlet
semantics that make it easy for other people to use your modules



We don’t want to go back to find the source code to find functions in the
modules



We don’t want ever time to see what parameter module accepts



You want option
-
WHATIF

CONFIRM

VERBOSE from the function in
modules












Demo


Built on top of WS
-
Management


Requires administrator privileges


To enable remoting


To connect to a remote session


Remoting output


Serialized property bags; not live objects


Related cmdlets


New
-
PSSession


Get
-
PSSession


Remove
-
PSSession


Export
-
PSSession


Import
-
PSSession


Enter
-
PSSession


Exit
-
PSSession


Invoke
-
Command



Interactive remoting


Works as if you are working at remote console


Enter
-
PSSession is used


Implicit remoting


Gets remote commands in to local session


Import
-
Session


Saving remote session to disk


Export
-
Session cmdlet is used


Custom session configuration can be created to restrict what a remote
user can perform










Demo


Splatting operator (@):



PowerShell V2 supports splatting operator (@) to pass a collection of
parameters



-
Split:



The
-
split operator enables a user to split a string into an array of
substrings, based on a separator.




Join:



The
-
join operator concatenates multiple strings from a string array into a
single string, separated by the separator.

Demo

Eventing allows actions to be taken or respond to the asynchronous
notifications when certain events occur



1. BitsTransmodule: We can transfer files or download files from internet
and we can configure to monitor download operation. Once download
completes eventing can be configured to notify the download
completion status

Background Jobs are used to Run the Jobs in the Back Ground
and allows to continue with other tasks in the shell



Start
-
Job

: Start the new Background Job


Get
-
Job

: Gets the list of job and there status


Receive
-
Job

: Receive Job is to get the result of the jobs running


Stop
-
Job

: Stop to stop the current running jobs


Wait
-
Job
: Wait for the prompt until the job continues


Remove
-
Job

: removes the Job details

Demo

Powers hell ISE, formerly known as Graphical Powershell, is a graphical
development environment and command prompt alternative.


You can view your PowerShell scripts, insert commands,debug and view the
output all at the same window


Demo

PowerShell allows ability to develop full transaction
-
based scripts
complete with cmdlets for starting, committing, and rolling back a
transaction in the event of an error or other condition.


This capability starts to make PowerShell an attractive choice for even the
most complex business processes as administrators can be more sure that
scripts can return data to its original state if necessary.




Start
-
Transaction



Get
-
Transaction



Use
-
Transaction



Complete
-
Transaction



Undo
-
Transaction



Demo

Remoting

Disable
-
PSSessionConfiguration

Enable
-
PSRemoting

Enable
-
PSSessionConfiguration

Enter
-
PSSession

Exit
-
PSSession

Export
-
PSSession

Get
-
PSSession

Get
-
PSSessionConfiguration

Import
-
PSSession

Invoke
-
Command

New
-
PSSession

New
-
PSSessionOption

New
-
WebServiceProxy

Register
-
PSSessionConfiguration

Remove
-
PSSession

Set
-
PSSessionConfiguration

Custom Sessions

Disable
-
PSSessionConfiguration

Enable
-
PSSessionConfiguration

Get
-
PSSessionConfiguration

New
-
PSSessionOption

Register
-
PSSessionConfiguration

Set
-
PSSessionConfiguration

Unregister
-
PSSessionConfiguration

Computers

Add
-
Computer

Checkpoint
-
Computer

Disable
-
ComputerRestore

Enable
-
ComputerRestore

Get
-
ComputerRestorePoint

Remove
-
Computer

Reset
-
ComputerPassword

Restart
-
Computer

Restore
-
Computer

Stop
-
Computer

Test
-
Connection

Other

Clear
-
History

Debug
-
Process

Export
-
FormatData

Get
-
FormatData

Get
-
Random

Import
-
LocalizedData

Out
-
GridView

Select
-
Xml

Send
-
MailMessage

Set
-
StrictMode

Start
-
Process

Test
-
ComputerSecureChannel

Update
-
List

Wait
-
Process

Debugging

Disable
-
PSBreakpoint

Enable
-
PSBreakpoint

Get
-
PSBreakpoint

Get
-
PSCallStack


Remove
-
PSBreakpoint

Set
-
PSBreakpoint

Type Conversion

Add
-
Type

ConvertFrom
-
Csv

ConvertFrom
-
StringData

ConvertTo
-
Csv

ConvertTo
-
Xml

Diagnostics

Clear
-
EventLog

Export
-
Counter

Get
-
Counter

Get
-
Hotfix

Get
-
WinEvent

Import
-
Counter

Limit
-
EventLog

New
-
EventLog

Remove
-
EventLog

Show
-
EventLog

Write
-
EventLog


Windows Powershell 2.0 CTP for XP and Vista

http://www.microsoft.com/technet/scriptcenter/topics/msh/download2.ms
px


Newsgroup:
Microsoft.Public.Windows.Powershell


PowerShell Team Blog
: http://blogs.msdn.com/Powershell


Scripting Guys Script Center
: microsoft.com/technet/scriptcenter



Krishna Kumar

http://smtpport25.wordpress.com