I got this figured out on a 2008 server, but it does't work on a 2012 r2. I would love to get some Ideas of where I can look up figuring out on my own how to get this script working on a 2012 server:
[string ] $userName = "tstest"
[ string] $description = "modified via powershell"
[ string] $computerName = $env:ComputerName
$DisableUser = 2 # ADS_USER_FLAG_ENUM enumeration value from SDK
$User = [ADSI ] "WinNT://$computerName / $userName,User"
$User .description = $description
$User .userflags = $DisableUser
$User .setinfo()
[ string] $description = "modified via powershell"
[ string] $computerName = $env:ComputerName
$DisableUser = 2 # ADS_USER_FLAG_ENUM enumeration value from SDK
$User = [ADSI ] "WinNT://$computerName / $userName,User"
$User .description = $description
$User .userflags = $DisableUser
$User .setinfo()
So how do I get ADSI and where can I learn how to make changes to it in PowerShell?
Can I be walked through the process of figuring out my own problems here?