[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-14 Thread Ken Schaefer
Do you need a PowerShell script? Dsmove.exe will do what you want. Just use a For Loop in a .bat or .vbs file http://technet.microsoft.com/en-us/library/cc731094.aspx Cheers Ken From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Dave Hardyman Sent:

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Melvin Backus
Do you need the users deleted / recreated, or do they just need to be removed from the OU then readded. If the later would moving them elsewhere temporarily then moving them back trigger the reactivation? -- There are 10 kinds of people in the world... those who understand binary and

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Dave Hardyman
They just need to be removed and readded after a 15 minute wait. I could use the same csv file for both operations. The problem is that there are about 7500 users in the OU and 1200 of them have suspended email accounts. Dave From: listsad...@lists.myitforum.com

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Melvin Backus
Then it sounds like creating a dummy OU, move the affected users to it, then 15 minutes later, move them back will suffice. That said, I specifically used delete/create instead of remove/readd in order to clarify that. Removing the account from the OU (move) does not equal removing the

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Michael B. Smith
Do the others stop working if you move them to another OU? From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Dave Hardyman Sent: Friday, September 12, 2014 10:03 AM To: ntsysadm@lists.myitforum.com Subject: [NTSysADM] RE: need a Powershell script to

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Dave Hardyman
The NetIQ appliance looks at the OU for account activation/deactivation. If a student is removed from the OU their Google email account will be suspended. If a student is added back to the OU their Google email account becomes active again. Adding a new student to the OU will trigger a new

[NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Christopher Bodnar
Something like this? get-qadUser -searchRoot OU=GMailUsers,dc=widgets,dc=com|move-qadobject -NewParentContainer OU=TempOU,dc=widgets,dc=com From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Dave Hardyman Sent: Friday, September 12, 2014 9:51 AM To:

RE: [NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Charles F Sullivan
It looks like you can’t provide pipeline input to the –identity parameter, and there probably are other ways around this, but here’s what I have done in the past, though it’s slightly convoluted. An example line would be: Move-ADObject -Identity CN=Student1,OU=students,DC=myschool,DC=edu

RE: [NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Charles F Sullivan
At the end of the line you better pipe the command to a log, for example: | out-file .\moveusers.log –append -noclobber *From:* listsad...@lists.myitforum.com [mailto: listsad...@lists.myitforum.com] *On Behalf Of *Charles F Sullivan *Sent:* Friday, September 12, 2014 11:42 AM *To:*

RE: [NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Aakash Shah
Another option in case the users are under various sub OUs is to use this: $UsersToMove = Import-Csv 'suspendedusers.csv' $NewOU = 'OU=SomeOtherOU,DC=domain,DC=edu' Get-ADUser -Filter SamAccountName -eq '$($UsersToMove.Username)' | Move-ADObject -TargetPath $NewOU -Verbose The CSV file should

RE: [NTSysADM] RE: need a Powershell script to resolve a campus student email problem

2014-09-12 Thread Charles F Sullivan
My mistake. You **can** provide pipeline input to the –identity parameter, so this would be a better solution, even though all the users are in the same OU. *From:* listsad...@lists.myitforum.com [mailto: listsad...@lists.myitforum.com] *On Behalf Of *Aakash Shah *Sent:* Friday, September 12,