April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

CHANGE LOGON SCRIPT IN AD

needed to change login scripts, or rather remove ’em as we replace ’em with GPOs. I exported the current scripts to a TXT and then just cleared the field in AD.

# Load the AD module
Import-module ActiveDirectory
# Get all the AD user who have a login script and save it to a textfile
Get-ADUser -filter * -properties scriptpath | ft Name, scriptpath > C:\LogonScript.txt -Force
# Clear the Logon script field in AD
Get-ADUser -Filter * -SearchBase “OU=RMOHAN,DC=RMOHAN,DC=COM” | Set-ADUser -Clear scriptPath

# Load the AD module
Import-module ActiveDirectory
# Get all the AD user who have a login script and save it to a textfile
Get-ADUser -filter * -properties scriptpath | ft Name, scriptpath > C:\LogonScript.txt -Force
# Clear the Logon script field in AD
Get-ADUser -Filter * -SearchBase “OU=RMOHAN,DC=RMOHAN,DC=COM” | Set-ADUser -Clear scriptP

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>