Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

disable user account importing csv file

Closed Thread
 
Thread Tools Display Modes
Old 07-15-2008   #1 (permalink)
panto.torre
Guest


 

disable user account importing csv file

I need a suggestion to create a script to disable user account (in
active directory) from a csv file

Thanks
Old 07-15-2008   #2 (permalink)
Brandon Shell [MVP]
Guest


 

Re: disable user account importing csv file

If you dont mind installing free quest tools from www.quest.com/powershell

get-qaduser <name> | disable-QADuser
Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
Quote:

> I need a suggestion to create a script to disable user account (in
> active directory) from a csv file
>
> Thanks
>

Old 07-15-2008   #3 (permalink)
panto.torre
Guest


 

Re: disable user account importing csv file

On 15 Lug, 17:07, Brandon Shell [MVP] <a_bshell.m...@xxxxxx>
wrote:
Quote:

> If you dont mind installing free quest tools fromwww.quest.com/powershell
>
> get-qaduser <name> | disable-QADuser
> Brandon Shell
> ---------------
> Blog:http://www.bsonposh.com/
> PSH Scripts Project: *www.codeplex.com/psobject
>
>
>
Quote:

> > I need a suggestion to create a script to disable user account (in
> > active directory) from a csv file
>
Quote:

> > Thanks- Nascondi testo citato
>
> - Mostra testo citato
ok, but i have to disable more than 1000 users that i have on csv
file...
Old 07-15-2008   #4 (permalink)
Brandon Shell [MVP]
Guest


 

Re: disable user account importing csv file

no problem (if you have headers)

$users = import-csv <csv File>
foreach($user in $user){disable-qaduser $user.Name -whatif}

disable-qaduser is going to want either DN or Domain\User. Replace Name with
the header name of the value you want to use.

Remove the whatif, assuming it works as expected.


Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
Quote:

> On 15 Lug, 17:07, Brandon Shell [MVP] <a_bshell.m...@xxxxxx>
> wrote:
>
Quote:

>> If you dont mind installing free quest tools
>> fromwww.quest.com/powershell
>>
>> get-qaduser <name> | disable-QADuser
>> Brandon Shell
>> ---------------
>> Blog:http://www.bsonposh.com/
>> PSH Scripts Project: www.codeplex.com/psobject
Quote:

>>> I need a suggestion to create a script to disable user account (in
>>> active directory) from a csv file
>>>
>>> Thanks- Nascondi testo citato
>>>
>> - Mostra testo citato
>>
> ok, but i have to disable more than 1000 users that i have on csv
> file...
>

Old 07-15-2008   #5 (permalink)
Brandon Shell [MVP]
Guest


 

Re: disable user account importing csv file

actually the allowable values to find the user for disable-qadusers is

DN, SID, GUID, UPN or Domain\Name

so you can use any of those.

Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
Quote:

> On 15 Lug, 17:07, Brandon Shell [MVP] <a_bshell.m...@xxxxxx>
> wrote:
>
Quote:

>> If you dont mind installing free quest tools
>> fromwww.quest.com/powershell
>>
>> get-qaduser <name> | disable-QADuser
>> Brandon Shell
>> ---------------
>> Blog:http://www.bsonposh.com/
>> PSH Scripts Project: www.codeplex.com/psobject
Quote:

>>> I need a suggestion to create a script to disable user account (in
>>> active directory) from a csv file
>>>
>>> Thanks- Nascondi testo citato
>>>
>> - Mostra testo citato
>>
> ok, but i have to disable more than 1000 users that i have on csv
> file...
>

Old 07-18-2008   #6 (permalink)
panto.torre
Guest


 

Re: disable user account importing csv file

On 15 Lug, 17:30, Brandon Shell [MVP] <a_bshell.m...@xxxxxx>
wrote:
Quote:

> actually the allowable values to find the user fordisable-qadusers is
>
> DN, SID, GUID, UPN or Domain\Name
>
> so you can use any of those.
>
> Brandon Shell
> ---------------
> Blog:http://www.bsonposh.com/
> PSH Scripts Project: *www.codeplex.com/psobject
>
>
>
Quote:

> > On 15 Lug, 17:07, Brandon Shell [MVP] <a_bshell.m...@xxxxxx>
> > wrote:
>
Quote:
Quote:

> >> If you dont mind installing free quest tools
> >> fromwww.quest.com/powershell
>
Quote:
Quote:

> >> get-qaduser <name> |disable-QADuser
> >> Brandon Shell
> >> ---------------
> >> Blog:http://www.bsonposh.com/
> >> PSH Scripts Project: *www.codeplex.com/psobject
> >>> I need a suggestion to create a script todisableuseraccount(in
> >>> active directory) from a csv file
>
Quote:
Quote:

> >>> Thanks- Nascondi testo citato
>
Quote:
Quote:

> >> - Mostra testo citato
>
Quote:

> > ok, but i have todisablemore than 1000 users that i have on csv
> > file...- Nascondi testo citato
>
> - Mostra testo citato
Many thanks!
work properly
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to migrate file from one user account to another Jixa Vista General 2 07-30-2008 06:08 PM
Disable User Account Control just for admin profile? Vista Home Premium Tuttle Vista General 7 06-11-2008 10:02 PM
Is it possible to disable the user account picture in the Start me Gabriel Lozano-Moran Vista account administration 5 01-15-2008 07:01 AM
User Account Control - Disable GW Vista security 2 11-18-2007 05:38 PM
Disable user account control Alan Vista security 2 06-12-2006 01:40 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50