Guest User

Untitled

a guest
Feb 10th, 2014
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $username  = "username@tenancy.onmicrosoft.com"
  2. $password = "PASSWORDHERE"
  3. $secstr = New-Object -TypeName System.Security.SecureString
  4. $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
  5. $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
  6. try
  7. {
  8.     $msc = Connect-MsolService -Credential $cred -ErrorAction Stop
  9.     Write-Output "Connected. <br />"
  10. }
  11. catch
  12. {
  13.     Write-Output "Could not connect. <br />"
  14. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×