Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Including a Script in a Deprovisioning Policy

$
0
0

Hi all,

 

I'm trying to write a script which is to be included as part of the deprov process and will, hopefully, move a user's profile folder from it's original location (in the \\server1\profile$ folder) into a sub folder in that location (server1\profile$\deprovisioned). It doesn't seem like a particularly tricky thing to do but i just can't seem to get it working.

 

I just noticed that in properties of the Default Company Deprovisioning Policy, under the Policies tab, while all the other Policies have small red arrows point top left by their icons (indicating they're part of the deprovisioning process) the icon for the script does not:

QuestDeprv.jpg

Does this indicate that the script won't run as part of the deprovisioning process? Is there something i need to enable/check to ensure the script gets the red arrow/becomes part of the deprov process?

 

 

The other possible reason is that the script i've written isn't formatted properly:

 

 

function onDeprovision($Request)

{

     if ($Request.class -eq "user")

          {

               $sAMAccountName = $Request.Get("sAMAccountName")

               Move-Item "\\server1\profile$\$sAMAccountName" "\\server1\profile$\Moved"

          }

}

 

 

Either way i'm slightly stumped so any help you could provide would be much appreciated!

Thanks


Viewing all articles
Browse latest Browse all 1277

Trending Articles