Power Shell Scripts

First script to connect to live@edu doamin.

# Define the URI which will connect to it.

$RemoteURI = “https://ps.outlook.com/powershell/
#Define the Administrator account for you live domain.

$Username = “<Live domain admin account>”

# Enter the password
$Password = ConvertTo-SecureString “<Live Admin Password>” -AsPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $Username, $Password
$sessionA = New-PSSession -ConnectionUri $RemoteURI -ConfigurationName Microsoft.Exchange -Authentication Basic -Credential $cred -AllowRedirection
Import-PSSession $sessionA -AllowClobber
# end of the script enjoy

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: