So I just found these WmsCmdlets the other day, and figured I would whip up a simple script to automate the provisioning of auto-logins. We use these to great effect in all of our computer labs, but it's always a drag spending the 10 minutes or so setting up the accounts. In our environment we use generic student AD accounts, but this script would work just as well with local accounts.
The only thing that is needed to use this script is that the accounts need to name sequentially e.g. student1, student2, student3, etc.. and have the same password. If there is any interest this script could easily be modified to hand command line arguments and be a little more flexible, but for now I designed this to work with my setup.
Function Convert-Base64 ([string]$arg1) { [System.Convert]::ToBase64String([System.Text.Encoding]::UNICODE.GetBytes($arg1)) } # Modify these vars with your account info $Domain = "DOMAIN" # Use "." for local accounts $WmsUser = "username" $WmsPass = "P@ssword" # Start Script Import-Module WmsCmdlets $Stations = Get-WmsStation $Count = 1 ForEach ($Station in $Stations.Id) { $User = $Domain + "\" + $WmsUser + $Count Set-WmsStation -StationId $Station -EnableAutoLogon -AutoLogonUserName $(Convert-Base64 $User) -AutoLogonPassword $(Convert-Base64 $WmsPass) if ($?) { $Count++ } else { Write-Host "There was an Error!" ; break } }