Hi,
I am get this error, when i am trying to run command from .ps1 file. Please let me know, how to run command directly from powershell prompt,Without double clicking on this file.
Regards,
Technology Tips and News
Hi,
I am get this error, when i am trying to run command from .ps1 file. Please let me know, how to run command directly from powershell prompt,Without double clicking on this file.
Regards,
Ensure you have AD (ActiveDirectory) Module Available in your machine
You need to install it before you run this script!
http://blogs.msdn.com/b/rkramesh/archive/2012/01/17/how-to-add-active-directory-module-in-powershell-in-windows-7.aspx
Hi Chen V,
Thank you for your quick reply. Now i am getting below error. Please see below print-screen.
It will be good if you share your code - Remove your domain server names and share with us - We can check and update you
CSV format as well! (Assuming a white space in your input csv file)
You do not need to reassign and quote everything:
New-AdUser -Name $user.DisplayName -GivenName $user.Firstname -Surname $user.LastName
Do not use quotes. You cannot have any blank f
Hi Param,
try also this way if you have empty fields:
Import-Module ActiveDirectory $users = Import-Csv -Path C:\temp\export\workspace.csv foreach ($user in $users) { $properties = @{} $user | Get-Member -Type NoteProperty | Select -Expand Name | Foreach { if ($user."$_") { $properties.Add("$_", $user."$_") } } Set-ADUser -Identity $user.sAMAccountName @properties -Verbose }