make a user in azure for pinpad


$name = "rapagent"


$msolcred = Get-Credential -UserName admin@netmagic.onmicrosoft.com -Message "password for netmagic is Fred!"
     Connect-MsolService -Credential $msolcred -ErrorAction Stop
 
 $setfed = Get-MsolDomainFederationSettings -DomainName "rapmlsqa.com"
 $alog = $setfed.ActiveLogOnUri
 
 $strarr = $alog.Split('/')
 $len = $strarr.Length
 
 #colc/8/BARS
 #appid/linkid/mlsid
 
 
 $mlsid = $strarr[$len - 1]
 $linkid = $strarr[$len - 2]
 $appid = $strarr[$len - 3]
 
 
 Get-MsolDomainFederationSettings -DomainName "rapmlsqa.com" -Verbose
 
 
 echo $mlsid
 echo $linkid
 echo $appid
 
 
     $upn = $name + "@rapmlsqa.com"
 
     $displayname = $name + "_at_Rapattoni"
 
     $someString = $name + $appID + $mlsID
     $bytes = [System.Text.Encoding]::Default.GetBytes($somestring)
    $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
     $hashbytes = $md5.ComputeHash($bytes)
     $result = [GUID]($hashbytes)
     $resultstring = $result.ToString();
     $resultstringbytes = [System.Text.Encoding]::Default.GetBytes($resultstring)
 
     $base64 = [System.Convert]::ToBase64String($resultstringbytes)
 
     new-msolUser –userprincipalname $upn -immutableID $base64 -lastname At_Rapattoni –firstname $name –Displayname $displayname -BlockCredential $false

Advertisements

About home_pw@msn.com

Computer Programmer who often does network administration with focus on security servers. Very strong in Microsoft Azure cloud!
This entry was posted in coding theory. Bookmark the permalink.