2
當我在命令行中運行以下命令參數傳遞到PowerShell的
powershell.exe "Import-Module ActiveDirectory;New-ADUser -name "rr"
-path "OU=Test,DC=Example,DC=com"
我得到的錯誤如下:
New-ADUser : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Path'. Specified method is not supported.
At line:1 char:56
+ Import-Module ActiveDirectory;New-ADUser -name rr -path <<<< OU=Test,DC=Example,DC=com
+ CategoryInfo : InvalidArgument: (:) [New-ADUser], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.Management.Commands.NewADUser
謝謝非常。它做到了。感謝你的幫助。 –