Welcome to UnableTo.com, where you can state any issue that you are unable to perform and receive answers from other members of the community.

Powershell - How to get AD-USER with LogonWorkstations and set to null

0 votes
Powershell - How to get AD-USER with LogonWorkstations and set to null

Powershell - How to set ad-user logonworkstations to empty
asked Oct 29, 2014 by Usevh25431 (1,450 points)

1 Answer

0 votes
 
Best answer

To get an output of current settings:

Get-ADUser -Filter * -Properties LogonWorkstations | where {$_.LogonWorkstations -ne $null} | Select-Object name,LogonWorkstations C:\temp\RestrictedUsers.csv

To set all LogonWorkstation values to empty or null run the following command

Get-ADUser -Filter * -Properties LogonWorkstations | where {$_.LogonWorkstations -ne $null} | Set-ADUser -LogonWorkstations $null

answered Oct 29, 2014 by admin (2,390 points)
...