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.

Categories

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

Powershell - How to set ad-user logonworkstations to empty
by (1.5k 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

by (2.6k points)
...