7 Replies Latest reply on Jan 19, 2012 3:31 PM by allenilx

    Creating Users

    allenilx

      I get the following error when creating new users with the User Import Tool

      could not load type 'microsoft.powershell.ExecutionPolicy Scope' from assembly 'system.management.automation'

      Powershell 2.0 is installed on the Exchange server and on the server running the User Import Tool (see below):

      PS C:\> $PSVersionTable

      Name                           Value
      ----                           -----
      CLRVersion                     2.0.50727.3615
      BuildVersion                   6.0.6002.18111
      PSVersion                      2.0
      WSManStackVersion              2.0
      PSCompatibleVersions           {1.0, 2.0}
      SerializationVersion           1.1.0.1
      PSRemotingProtocolVersion      2.1

      Thanks in advance

        • Re: Creating Users
          michalB

          Hello, is there anything interesting in the log? Go to Settings, enable Debug/Verbose logging, and reproduce the issue again. Then check the log file in C:\ProgramData\SolarWinds\UserImportTool.

            • Re: Creating Users
              allenilx

              Below is the entries in the log file from C:\Documents and Settings\All Users\Application Data\SolarWinds\UserImportTool

              Also, the error only occurs when trying to create an exchange mailbox. Creating just the AD user works fine. The error also occurs on other domain controllers as well.

               

              2012-01-19 09:14:31,087 [14] DEBUG UserImportTool.Logger - Credentilas updated:
              2012-01-19 09:14:31,087 [14] DEBUG UserImportTool.Logger - Testing credentials: wl administrator
              2012-01-19 09:14:31,134 [14] DEBUG UserImportTool.Logger - Settings saved mail2 administrator
              2012-01-19 09:14:32,540 [15] DEBUG UserImportTool.Logger - Preload user import
              2012-01-19 09:14:32,540 [15] DEBUG UserImportTool.Logger - Parsing file: E:\EmailUsers\AddUsers4.csv
              2012-01-19 09:14:32,540 [15] DEBUG UserImportTool.Logger - Parsinf CSV file
              2012-01-19 09:14:32,556 [15] DEBUG UserImportTool.Logger - Settings saved mail2 administrator
              2012-01-19 09:14:32,556 [15] DEBUG UserImportTool.Logger - Getting Default organization unit
              2012-01-19 09:14:32,556 [15] DEBUG UserImportTool.Logger - Getting default Organizational Unit.
              2012-01-19 09:14:32,587 [15] DEBUG UserImportTool.Logger - Checking if service has being installed
              2012-01-19 09:14:32,853 [15] DEBUG UserImportTool.Logger - Connecting to WMI
              2012-01-19 09:14:32,868 [15] ERROR UserImportTool.Logger - Can't check or start service
              System.Management.ManagementException: User credentials cannot be used for local connections
                 at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
                 at System.Management.ManagementScope.InitializeGuts(Object o)
                 at System.Management.ManagementScope.Initialize()
                 at UserImportTool.ServiceInstaller.RemoteServiceController.Refresh(String host, String login, String password, String serviceName)
                 at UserImportTool.ServiceInstaller.MSIInstaller.InstallService(String filename, CredentialsInfo cresentials, String adminShare, String serviceName, String logfilename, Action`2 callback, String& message)
              2012-01-19 09:14:32,868 [15] DEBUG UserImportTool.Logger - Stating service installation
              2012-01-19 09:14:32,868 [15] DEBUG UserImportTool.Logger - Deploying file mail2\ADMIN$\ServiceInstaller.msi
              2012-01-19 09:14:32,900 [15] DEBUG UserImportTool.Logger - Starting MSI mail2\ADMIN$\ServiceInstaller.msi Log file:
              2012-01-19 09:14:32,915 [15] ERROR UserImportTool.Logger - Can't install service
              System.Management.ManagementException: User credentials cannot be used for local connections
                 at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
                 at System.Management.ManagementScope.InitializeGuts(Object o)
                 at System.Management.ManagementScope.Initialize()
                 at UserImportTool.ServiceInstaller.MSIInstaller.RunMSI(String filename, String host, String username, String password, String adminShare, String logfilename)
                 at UserImportTool.ServiceInstaller.MSIInstaller.InstallService(String filename, CredentialsInfo cresentials, String adminShare, String serviceName, String logfilename, Action`2 callback, String& message)
              2012-01-19 09:14:35,993 [15] DEBUG UserImportTool.Logger - Getting Exchange Default databases
              2012-01-19 09:14:35,993 [15] DEBUG UserImportTool.Logger - Getting Default databases
              2012-01-19 09:14:36,665 [15] ERROR UserImportTool.Logger - Can't get default databases.
              System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
              System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn...).
              2012-01-19 09:14:36,665 [15] DEBUG UserImportTool.Logger - Getting Mailbox user properties
              2012-01-19 09:14:36,775 [15] ERROR UserImportTool.Logger - Can not load Mailbox properties
              System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
              System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn...).
              2012-01-19 09:14:36,775 [1] DEBUG UserImportTool.Logger - Starting field names match
              2012-01-19 09:14:46,728 [17] DEBUG UserImportTool.Logger - Creating Exchange mailboxes
              2012-01-19 09:14:47,040 [17] ERROR UserImportTool.Logger - Failed to create user:Allen Weinberg[System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
              System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
              Loader Exceptions:

              Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
              Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                 at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn...).]
              2012-01-19 09:14:47,040 [17] DEBUG UserImportTool.Logger - Could not create the following users: Allen Weinberg[Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.Loader Exceptions: Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]

                • Re: Creating Users
                  michalB

                  Are you running the tool on the Exchange server? If so, please make sure you have the "This machine is the Exchange server" checkbox checked. If that does not help, please post a new log.

                    • Re: Creating Users
                      allenilx

                      I checked off the "User Tool is being run on the Exchange Server" and here are the new logs.  I get the same error when running it on another domain controller that is NOT the exchnage server.

                       

                      2012-01-19 09:14:47,040 [17] DEBUG UserImportTool.Logger - Could not create the following users: Allen Weinberg[Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.Loader Exceptions: Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
                      2012-01-19 12:40:24,191 [13] DEBUG UserImportTool.Logger - Testing credentials: wl administrator
                      2012-01-19 12:40:24,223 [13] DEBUG UserImportTool.Logger - Settings saved mail2 administrator
                      2012-01-19 12:40:27,723 [12] DEBUG UserImportTool.Logger - Credentilas updated:
                      2012-01-19 12:40:27,723 [12] DEBUG UserImportTool.Logger - Preload user import
                      2012-01-19 12:40:27,723 [12] DEBUG UserImportTool.Logger - Parsing file: E:\EmailUsers\AddUsers4.csv
                      2012-01-19 12:40:27,723 [12] DEBUG UserImportTool.Logger - Parsinf CSV file
                      2012-01-19 12:40:27,754 [12] DEBUG UserImportTool.Logger - Settings saved mail2 administrator
                      2012-01-19 12:40:27,754 [12] DEBUG UserImportTool.Logger - Getting Default organization unit
                      2012-01-19 12:40:27,754 [12] DEBUG UserImportTool.Logger - Getting default Organizational Unit.
                      2012-01-19 12:40:27,754 [12] DEBUG UserImportTool.Logger - Getting Exchange Default databases
                      2012-01-19 12:40:27,754 [12] DEBUG UserImportTool.Logger - Getting Default databases
                      2012-01-19 12:40:27,770 [12] ERROR UserImportTool.Logger - Can't get default databases.
                      System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
                      Loader Exceptions:

                      Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                      Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIns(Collection`1 mshsnapinInfos, PSConsoleLoadException& warning)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration()
                         at System.Management.Automation.Runspaces.RunspaceConfiguration.Create()
                         at ADImportServiceLib.Exchange.Exchange2007.IsAvailable()
                         at ADImportServiceLib.Exchange.ExchangeFactory.GetExchangeInstance(Dictionary`2 parameters)
                         at UserImportTool.Model.UserImportController.GetDefaultDatabase()
                      2012-01-19 12:40:27,770 [12] DEBUG UserImportTool.Logger - Getting Mailbox user properties
                      2012-01-19 12:40:27,785 [12] ERROR UserImportTool.Logger - Can not load Mailbox properties
                      System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
                      Loader Exceptions:

                      Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                      Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIns(Collection`1 mshsnapinInfos, PSConsoleLoadException& warning)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration()
                         at System.Management.Automation.Runspaces.RunspaceConfiguration.Create()
                         at ADImportServiceLib.Exchange.Exchange2007.IsAvailable()
                         at ADImportServiceLib.Exchange.ExchangeFactory.GetExchangeInstance(Dictionary`2 parameters)
                         at UserImportTool.Model.UserImportController.GetAllMailboxProperties(Boolean isLocal, Dictionary`2& allProps)
                      2012-01-19 12:40:27,785 [1] DEBUG UserImportTool.Logger - Starting field names match
                      2012-01-19 12:40:38,410 [9] DEBUG UserImportTool.Logger - Creating Exchange mailboxes
                      2012-01-19 12:40:38,410 [9] ERROR UserImportTool.Logger - System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
                      Loader Exceptions:

                      Could not load type 'System.Management.Automation.Host.IHostSupportsInteractiveSession' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                      Could not load type 'System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIns(Collection`1 mshsnapinInfos, PSConsoleLoadException& warning)
                         at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration()
                         at System.Management.Automation.Runspaces.RunspaceConfiguration.Create()
                         at ADImportServiceLib.Exchange.Exchange2007.IsAvailable()
                         at ADImportServiceLib.Exchange.ExchangeFactory.GetExchangeInstance(Dictionary`2 parameters)
                         at UserImportTool.Model.UserImportController.ImportUsers(Boolean createADOnly, List`1 users)

                        • Re: Creating Users
                          michalB

                          User Import Tool uses PowerShell snap-ins for Exchange server to create the mailboxes. The snap-in is usually installed with Exchange Server, but from some reason, the Exchange snap-in cannot be loaded on your machine. You should make sure the Powershell and the exchange snapins are correctly installed and configured on the Exchange server.

                          For instance, you can run the Exchange Shell and try executing some of the simple commands like "get-mailbox" to see whether it works. The errors you will see may tell us more about the issue.