November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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>