Powershel script

Hi buddies,
                   Can anyone help me with the powershell script which can create both servivce account and domain local group in Windows 2K3 environment.

Thanks
  Aj
LVL 1
aspathakAsked:
Who is Participating?
 
aspathakConnect With a Mentor Author Commented:
Here is what I was looking for. Anyone can refer the link  :)

http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Bulk-AD-Group-4d873f35
0
 
Peter HutchisonSenior Network Systems SpecialistCommented:
To create a local group:
param($computer="localhost", $group)
$objOu = [ADSI]"WinNT://$computer"
$objUser = $objOU.Create("Group", $group)
 $objUser.SetInfo()
$objUser.description = "Test Group"
$objUser.SetInfo()

To create a local account:
param($computer="localhost", $user, $password)
$objOu = [ADSI]"WinNT://$computer"
 $objUser = $objOU.Create("User", $user)
 $objUser.setpassword($password)
$objUser.SetInfo()
$objUser.description = "Test user"
$objUser.SetInfo()

To add a user to a local group e.g. Administrators use:
param($computer="localhost", $user, $group)
$objOU = [ADSI]"WinNT://$computer/$group,group"
 $objOU.add("WinNT://$computer/$user")
0
 
aspathakAuthor Commented:
I need the bulk AD group creation via script and need the input to be imported frm excel sheet
0
 
aspathakAuthor Commented:
this script will import the AD group info from .Csv file
0
All Courses

From novice to tech pro — start learning today.