HighTechTalks DotNet Forums  

WMI user accounts

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss WMI user accounts in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ahmed Ilyas
 
Posts: n/a

Default WMI user accounts - 09-03-2006 , 05:58 PM






Sorry if this is the wrong newsgroup, was not sure where to post this but if
it is in the incorrect newsgroup, please do tell me where the best place is
to post this.

I want to know if it is possible to create a user account using WMI? (Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding tool
that Microsoft has however I only see a rename method but thats it - nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts (locally)
using WMI?

Thanks!

Reply With Quote
  #2  
Old   
Gino
 
Posts: n/a

Default Re: WMI user accounts - 09-03-2006 , 09:16 PM






strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote

Quote:
Sorry if this is the wrong newsgroup, was not sure where to post this but
if
it is in the incorrect newsgroup, please do tell me where the best place
is
to post this.

I want to know if it is possible to create a user account using WMI? (Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!



Reply With Quote
  #3  
Old   
Ahmed Ilyas
 
Posts: n/a

Default Re: WMI user accounts - 09-03-2006 , 09:57 PM



Thanks very much Gino, much appreciated. Now to find a way to convert to
C#.NET!
the "Create" method, is that an actual method used that we can "Invoke"?

"Gino" wrote:

Quote:
strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:99A83392-9F35-40CE-AFB0-B79D3BB471E3 (AT) microsoft (DOT) com...
Sorry if this is the wrong newsgroup, was not sure where to post this but
if
it is in the incorrect newsgroup, please do tell me where the best place
is
to post this.

I want to know if it is possible to create a user account using WMI? (Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!




Reply With Quote
  #4  
Old   
Gino
 
Posts: n/a

Default Re: WMI user accounts - 09-04-2006 , 12:24 AM



If your looking to write an entire management program in C# look into
SYSTEM.MANAGEMENT for the Microsoft prebuilt assemblies.

If your looking for Admin type management scripts your better off sticking
to vbscript using WMI, ADSI and LDAP providers.

They have almost unlimited ability to Manage Local and Active Directory
domains such as users, groups, computers, printers and such.



An example would be to read the name, user ID, password, description, and
group membership for 1,000 accounts from an excel spreadsheet and create
them all in a few seconds in an Active Directory Domain.



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks very much Gino, much appreciated. Now to find a way to convert to
C#.NET!
the "Create" method, is that an actual method used that we can "Invoke"?

"Gino" wrote:

strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:99A83392-9F35-40CE-AFB0-B79D3BB471E3 (AT) microsoft (DOT) com...
Sorry if this is the wrong newsgroup, was not sure where to post this
but
if
it is in the incorrect newsgroup, please do tell me where the best
place
is
to post this.

I want to know if it is possible to create a user account using WMI?
(Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding
tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!






Reply With Quote
  #5  
Old   
Ahmed Ilyas
 
Posts: n/a

Default Re: WMI user accounts - 09-05-2006 , 08:41 AM



oh yes I am aware of that however I meant in terms of using the vbscript/wmi
script in C# on how to convert it to that (since im fairly new to the
Management classes) :-)

"Gino" wrote:

Quote:
If your looking to write an entire management program in C# look into
SYSTEM.MANAGEMENT for the Microsoft prebuilt assemblies.

If your looking for Admin type management scripts your better off sticking
to vbscript using WMI, ADSI and LDAP providers.

They have almost unlimited ability to Manage Local and Active Directory
domains such as users, groups, computers, printers and such.



An example would be to read the name, user ID, password, description, and
group membership for 1,000 accounts from an excel spreadsheet and create
them all in a few seconds in an Active Directory Domain.



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:A86B06D8-E8E4-44AF-8F12-52520F5F6EF2 (AT) microsoft (DOT) com...
Thanks very much Gino, much appreciated. Now to find a way to convert to
C#.NET!
the "Create" method, is that an actual method used that we can "Invoke"?

"Gino" wrote:

strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:99A83392-9F35-40CE-AFB0-B79D3BB471E3 (AT) microsoft (DOT) com...
Sorry if this is the wrong newsgroup, was not sure where to post this
but
if
it is in the incorrect newsgroup, please do tell me where the best
place
is
to post this.

I want to know if it is possible to create a user account using WMI?
(Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding
tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!







Reply With Quote
  #6  
Old   
Ahmed Ilyas
 
Posts: n/a

Default Re: WMI user accounts - 09-05-2006 , 06:26 PM



I can do this in the DirectoryServices namespace no problem, its just using
the Management classes that I have problems with, no idea where to begin or
how to invoke the method into WMI for adding a user account

"Gino" wrote:

Quote:
If your looking to write an entire management program in C# look into
SYSTEM.MANAGEMENT for the Microsoft prebuilt assemblies.

If your looking for Admin type management scripts your better off sticking
to vbscript using WMI, ADSI and LDAP providers.

They have almost unlimited ability to Manage Local and Active Directory
domains such as users, groups, computers, printers and such.



An example would be to read the name, user ID, password, description, and
group membership for 1,000 accounts from an excel spreadsheet and create
them all in a few seconds in an Active Directory Domain.



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:A86B06D8-E8E4-44AF-8F12-52520F5F6EF2 (AT) microsoft (DOT) com...
Thanks very much Gino, much appreciated. Now to find a way to convert to
C#.NET!
the "Create" method, is that an actual method used that we can "Invoke"?

"Gino" wrote:

strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:99A83392-9F35-40CE-AFB0-B79D3BB471E3 (AT) microsoft (DOT) com...
Sorry if this is the wrong newsgroup, was not sure where to post this
but
if
it is in the incorrect newsgroup, please do tell me where the best
place
is
to post this.

I want to know if it is possible to create a user account using WMI?
(Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding
tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!







Reply With Quote
  #7  
Old   
Rashad Rivera
 
Posts: n/a

Default Re: WMI user accounts - 09-22-2006 , 11:19 PM



Ahmed,

To my knowlege, it is not posible to create user accouts via WMI, but it
is posible to create user accounts via ADSI and LDAP. To do this you will
need to use the System.DirectoryService namespace and classes.

- Peace be with you in Jesus

Rashad Rivera

"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote

Quote:
I can do this in the DirectoryServices namespace no problem, its just using
the Management classes that I have problems with, no idea where to begin
or
how to invoke the method into WMI for adding a user account

"Gino" wrote:

If your looking to write an entire management program in C# look into
SYSTEM.MANAGEMENT for the Microsoft prebuilt assemblies.

If your looking for Admin type management scripts your better off
sticking
to vbscript using WMI, ADSI and LDAP providers.

They have almost unlimited ability to Manage Local and Active Directory
domains such as users, groups, computers, printers and such.



An example would be to read the name, user ID, password, description, and
group membership for 1,000 accounts from an excel spreadsheet and create
them all in a few seconds in an Active Directory Domain.



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:A86B06D8-E8E4-44AF-8F12-52520F5F6EF2 (AT) microsoft (DOT) com...
Thanks very much Gino, much appreciated. Now to find a way to convert
to
C#.NET!
the "Create" method, is that an actual method used that we can
"Invoke"?

"Gino" wrote:

strComputer = "PUT COMPUTER NAME HERE"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "PUT USER ACCOUNT HERE")
objUser.SetPassword "PUT PASSWORD HERE"
objUser.SetInfo



"Ahmed Ilyas" <AhmedIlyas (AT) discussions (DOT) microsoft.com> wrote in message
news:99A83392-9F35-40CE-AFB0-B79D3BB471E3 (AT) microsoft (DOT) com...
Sorry if this is the wrong newsgroup, was not sure where to post
this
but
if
it is in the incorrect newsgroup, please do tell me where the best
place
is
to post this.

I want to know if it is possible to create a user account using WMI?
(Im
using .NET but can almost easily convert WMI VBscript into .NET)
I've tried looking at the methods etc... using the WMI script coding
tool
that Microsoft has however I only see a rename method but thats it -
nothing
about creating a user account.

would I be correct in saying that you cannot create user accounts
(locally)
using WMI?

Thanks!









Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.