{"id":6841,"date":"2017-07-05T12:46:24","date_gmt":"2017-07-05T04:46:24","guid":{"rendered":"http:\/\/rmohan.com\/?p=6841"},"modified":"2017-07-05T12:46:24","modified_gmt":"2017-07-05T04:46:24","slug":"change-logon-script-in-ad","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6841","title":{"rendered":"CHANGE LOGON SCRIPT IN AD"},"content":{"rendered":"<p>needed to change login scripts, or rather remove \u2019em as we replace \u2019em with GPOs. I exported the current scripts to a TXT and then just cleared the field in AD.<\/p>\n<div class=\"crayon-plain-wrap\"># Load the AD module<br \/>\nImport-module ActiveDirectory<br \/>\n# Get all the AD user who have a login script and save it to a textfile<br \/>\nGet-ADUser -filter * -properties scriptpath | ft Name, scriptpath &gt; C:\\LogonScript.txt -Force<br \/>\n# Clear the Logon script field in AD<br \/>\nGet-ADUser -Filter * -SearchBase &#8220;OU=RMOHAN,DC=RMOHAN,DC=COM&#8221; | Set-ADUser -Clear scriptPath<\/p>\n<p># Load the AD module<br \/>\nImport-module ActiveDirectory<br \/>\n# Get all the AD user who have a login script and save it to a textfile<br \/>\nGet-ADUser -filter * -properties scriptpath | ft Name, scriptpath &gt; C:\\LogonScript.txt -Force<br \/>\n# Clear the Logon script field in AD<br \/>\nGet-ADUser -Filter * -SearchBase &#8220;OU=RMOHAN,DC=RMOHAN,DC=COM&#8221; | Set-ADUser -Clear scriptP<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>needed to change login scripts, or rather remove \u2019em as we replace \u2019em with GPOs. I exported the current scripts to a TXT and then just cleared the field in AD.<\/p>\n<p> # Load the AD module Import-module ActiveDirectory # Get all the AD user who have a login script and save it to a textfile [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6841"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6841"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6841\/revisions"}],"predecessor-version":[{"id":6842,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6841\/revisions\/6842"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}