![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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! |
#3
| |||
| |||
|
|
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! |
#4
| |||
| |||
|
|
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! |
#5
| |||
| |||
|
|
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! |
#6
| |||
| |||
|
|
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! |
#7
| |||
| |||
|
|
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! |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |