Hello,
I'm attempting to automate a part of our user creation/modification process and I've created a script that works on the Adaxes server in PowerShell but when I try to use the command in the Adaxes PowerShell Script Editor I get error messages because it won't import the module.
Here's the powershell code that I'm using:
Import-Module ActiveDirectory
Import-Module Quest.AuthenticationServices
$NewUID = Get-ADUser -Filter {uidnumber -ne "$null"} -Properties uidnumber |
sort uidnumber |
select -last 1 -expand uidnumber
$NewUID++
Enable-QasUnixUser %username%
Set-QASUnixUser %username% -Gecos "%fullname%, %department%" -UidNumber $NewUID
When I originally ran this code I didn't have the Import-Module lines but I got an error stating that it didn't recognize Get-ADUser or any of the Quest commands. After I entered Import-Module ActiveDirectory I got this error:
Run Script
The 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ActiveDirectory\ActiveDirectory.psd1' module cannot be imported because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport'). Remove the members that are not valid ('HelpInfoUri'), then try to import the module again.
Can you tell me if it's possible to run this command in Adaxes or if there's some modification that I need to make to get this working properly? The Quest Powershell commands are installed on the Adaxes server as well.
Thank you!