PSRemotingTransportException when invoking command on a distant server
Hello,
I'm having some trouble when I try to call Invoke-Command in powershell on a distant server.
I'm receiving a PSRemotingTransportException. It tells me that the user is either unknown or associated with a wrong password.
I've run the following commands on the distant server :
Set-ExecutionPolicy RemoteSignedwinrm quickconfigEnable-PSRemoting
and the user is in the administrator group of the distant server.
When I try with another user, it works.
What I am missing ? Can anyone help me ?
Thanks in advance !
Hi,
Are you able to use Enter-PSSession as the user in question? Also, what's the full error text?
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)
Similar Messages
-
Are there any memory restrictions when using Invoke-Command?
Hi, I'm using the Invoke-PSCommandSample workbook to run a batch file inside a VM.
The batch file inside the VM runs a Java program.
The batch file works fine, when I run it manually in the VM.
However, when I use the Invoke-PSCommandSample workbook to run the batch file, I get the following error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
errorlevel=1
Press any key to continue . . .
Does anybody know if there are any memory restrictions when invoking commands inside a VM via runbook?
Thanks in advance.Hi Joe, I'll give some more background information. I'm doing load testing with JMeter in Azure and I want to automate the task. This is my runbook:
workflow Invoke-JMeter {
$Cmd = "& 'C:\Program Files (x86)\apache-jmeter-2.11\bin\jmeter-runbook.bat'"
$Cred = Get-AutomationPSCredential -Name "[email protected]"
Invoke-PSCommandSample -AzureSubscriptionName "mysubscription" -ServiceName "myservice" -VMName "mymachine" -VMCredentialName "myuser" -PSCommand $Cmd -AzureOrgIdCredential $Cred
This is my batch file inside the VM:
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
set PATH=%JAVA_HOME%\bin;%PATH%
%COMSPEC% /c "%~dp0jmeter.bat" -n -t build-web-test-plan.jmx -l build-web-test-plan.jtl -j build-web-test-plan.log
Initially I tried to run JMeter with "-Xms2048m -Xmx2048m". As that didn't work, I lowered the memory allocation but even with "-Xms128m -Xmx128m" it does not work. I have tried with local PowerShell ISE as you suggested, but I'm
running into certification issues. I'm currently have a look at this. Here's my local script:
Add-AzureAccount
Select-AzureSubscription -SubscriptionName "mysubscription"
$Uri = Get-AzureWinRMUri -ServiceName "myservice" -Name "mymachine"
$Credential = Get-Credential
$Cmd = "& 'C:\Program Files (x86)\apache-jmeter-2.11\bin\jmeter-runbook.bat'"
Invoke-command -ConnectionUri $Uri -credential $Credential -ScriptBlock {
Invoke-Expression $Args[0]
} -Args $Cmd
With this, I get the following error (sorry, it is in German):
[myservice.cloudapp.net] Beim Verbinden mit dem Remoteserver "myservice.cloudapp.net" ist folgender Fehler
aufgetreten: Das Serverzertifikat auf dem Zielcomputer (myservice.cloudapp.net:666) enthält die folgenden
Fehler:
Das SSL-Zertifikat ist von einer unbekannten Zertifizierungsstelle signiert. Weitere Informationen finden Sie im
Hilfethema "about_Remote_Troubleshooting".
+ CategoryInfo : OpenError: (myservice.cloudapp.net:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : 12175,PSSessionStateBroken -
Oracle Server 11.2.0.1.0 64-bit fails when invoked from InstallShield
I'm trying to install the Oracle Server 11.2.0.1.0 64-bit on Windows 2008 SP1 from the InstallShield 2010.
The installation is silent. Invoked by command line:
J:\Oracle_11.2.0_x64\OracleServer_11.2.0.1_x64\setup.exe ORACLE_HOME_NAME="ARAXI_11" -silent -nowelcome -force -nowait -noconsole -loglevel fine -noconfig -ignoreSysPrereqs use_prereq_checker=false -responseFile C:\Oracle\11.2.0\installation\scripts\SVRCUSTOM11.2.0.rsp
The problem is that when the command is invoked from command line (cmd), the installation is successful.
However, when the same command is invoked from under the InstallShield, the installation fails on Architecture requirement check:
INFO: *********************************************
INFO: Architecture: This is a prerequisite condition to test whether the system has a certified architecture.
INFO: Severity:CRITICAL
INFO: OverallStatus:OPERATION_FAILED
INFO: All forked task are completed at state performChecks
INFO: Completed background operations
INFO: Moved to state <performChecks>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <performChecks>
INFO: Using default Validator configured in the Action class oracle.install.ivw.db.action.PrereqAction
INFO: Adding ExitStatus PREREQUISITES_NOT_MET to the exit status set
SEVERE: [FATAL] [INS-13013] Target environment do not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. C:\Oracle\Inventory\logs\installActions2011-05-19_12-58-13PM.log
ACTION: Identify the list of failed prerequisite checks from the log: C:\Oracle\Inventory\logs\installActions2011-05-19_12-58-13PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
INFO: Advice is ABORT
INFO: Adding ExitStatus INVALID_USER_INPUT to the exit status set
The questions:
1. Why the requirement checks give different results when installation is invoked from CMD and from InstallShield?
2. Why the requirement checks are done despite the parameters "-ignoreSysPrereqs" and "use_prereq_checker=false"?
3. What should I do to get the installation pass (either remove the check or make it satisfying)?
PS. The 32 bit Oracle Server installation on Windows 2003 works without problem when invoked from InstallShield.Please use 2008R2 if you want to install 11gR2 versionThank you for that update. Possibly it will help me to solve another trouble.
Regarding the problem I described, the issue is that I install Oracle Client 32 bit prior to trying to install Oracle Servier 64 bit.
The Oracle Client setup had started RemoteExecService.exe 32 bit process. And the process remained running after the installation completed.
The Oracle Server setup utilizes the running RemoteExecService.exe process. Since the process is 32 bit, the architecture requirement check had failed.
I've added to my script killing the process
taskkill /F /IM RemoteExecService.exe
before invoking the Oracle Server installation.
That way the Oracle Server setup starts another RemoteExecService.exe process and the new process is 64 bit.
The architecture requirement succeed. -
How can you run a command with elevated rights on a remote server with invoke-command ?
I am trying to run a script on a remote server with invoke-command. The script is starting and is running fine, but the problem is that it should be running with elevated rights on the remote server. On the server where I start the invoke-command, my account has the necessary rights.
The server were I launch the invoke-command is a W2K8 R2. The remote box is a W2K3 with powershell v2.0 installed.
When I launch the script on the remote-box from the command line, I don't get the access denied's.
Is there a way to do this ?
Thanks in advanceThe script that I want to run is to install the windows updates. I get an access denied on the download of the updates.
When I execute the script on an W2K8 box, (not remotely) and I run it with non-elevated rights, I get the same error.
The script is running fine when it is launched on W2K3 box locally with a domain account that has local admin rights, or on a W2K8 R2 server with a domain account that has local admin rights, but with elevated rights.
Thanks in advance for your help.
#=== start script ====
param($installOption="TESTINSTALL",$rebootOption="NOREBOOT")
Function Show-Help
Write-Host ""
Write-Host "SCRIPT: $scriptName <installOption> <RebootOption>"
Write-Host ""
Write-Host "DESCRIPTION: Installatie van WSUS updates op de lokale server"
Write-Host ""
Write-Host "PARAMETERS"
Write-Host " -installOption <[INSTALL|TESTINSTALL]>"
Write-Host " -rebootOption <[REBOOT|NOREBOOT|REBOOT_IF_UPDATED]>"
Write-Host ""
Write-Host "EXAMPLE:"
Write-Host "$ScriptName -installOption INSTALL -rebootOption REBOOT_IF_UPDATED"
Write-Host "$ScriptNAme INSTALL NOREBOOT"
Write-Host ""
Write-Host "Indien beide parameter weggelaten worden zijn de defaultwaarden :"
Write-Host " installOption=TESTINSTALL "
Write-Host " RebootOption=NOREBOOT"
Write-Host ""
Exit
#Include alle globale variablen
$CEIF_WIN_PATH = (get-content env:CEIF_WIN_PATH)
$includeFile=$CEIF_WIN_PATH + "\Scripts\include_win.ps1"
. $includeFile
#initialiseer error count
$errcnt=0
$scriptName=$MyInvocation.MyCommand.Name
#argumenten controleren
$arrInstallOption= "TESTINSTALL", "INSTALL" # Mandatory variable with predefined values
If (!($arrInstallOption –contains $installOption)){ Show-Help }
$arrRebootOption = "REBOOT", "NOREBOOT","REBOOT_IF_UPDATED" # Mandatory variable with predefined values
If (!($arrRebootOption –contains $rebootOption)){ Show-Help }
#Logfile opbouwen
$logfile = get-logfileName($MyInvocation.MyCommand.Name)
Log-scriptStart $MyInvocation.MyCommand.Name $logfile
function Get-WIAStatusValue($value)
switch -exact ($value)
0 {"NotStarted"}
1 {"InProgress"}
2 {"Succeeded"}
3 {"SucceededWithErrors"}
4 {"Failed"}
5 {"Aborted"}
function boot-server()
if ($installOption -eq "TESTINSTALL")
logger "TESTINSTALL : - Reboot local Server" $logfile
else
logger " - Reboot local Server" $logfile
$thisServer = gwmi win32_operatingsystem
$thisServer.psbase.Scope.Options.EnablePrivileges = $true
$thisServer.Reboot()
$logmsg="Install option = " + $installOption + ", RebootOption = $rebootOption"
logger "$logmsg" $logfile
logger "" $logfile
logger " - Creating WU COM object" $logfile
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
logger " - Searching for Updates" $logfile
$SearchResult = $UpdateSearcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0")
logger " - Found [$($SearchResult.Updates.count)] Updates to Download and install" $logfile
$Updates=$($SearchResult.Updates.count)
logger "" $logfile
foreach($Update in $SearchResult.Updates)
if ($Update.EulaAccepted -eq 0)
$Update.AcceptEula()
# Add Update to Collection
$UpdatesCollection = New-Object -ComObject Microsoft.Update.UpdateColl
$UpdatesCollection.Add($Update) | out-null
if ($installOption -eq "TESTINSTALL")
else
# Download
logger " + Downloading Update $($Update.Title)" $logfile
$UpdatesDownloader = $UpdateSession.CreateUpdateDownloader()
$UpdatesDownloader.Updates = $UpdatesCollection
$DownloadResult = $UpdatesDownloader.Download()
$Message = " - Download {0}" -f (Get-WIAStatusValue $DownloadResult.ResultCode)
if ($DownloadResult.ResultCode -eq 4 )
{ $errcnt = 1 }
logger $message $logfile
# Install
logger " - Installing Update" $logfile
$UpdatesInstaller = $UpdateSession.CreateUpdateInstaller()
$UpdatesInstaller.Updates = $UpdatesCollection
$InstallResult = $UpdatesInstaller.Install()
$Message = " - Install {0}" -f (Get-WIAStatusValue $InstallResult.ResultCode)
if ($InstallResult.ResultCode -eq 4 )
{ $errcnt = 1 }
logger $message $logfile
logger "" $logfile
#Indien er een fout gebeurde tijdens download/installatie -> stuur mail naar windowsteam
if ( $errcnt -gt 0 )
logger " - Fout tijdens de uitvoering van script -> send mail" $logfile
$mailSubject=$MyInvocation.MyCommand.Name
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($logfile)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = $mailFrom
$msg.To.Add($mailTo)
$msg.Subject = $mailSubject
$msg.Body = “Meer details in attachement”
$msg.Attachments.Add($att)
$smtp.Send($msg)
#Moet de server herstart worden ?
if ($rebootOption -eq "REBOOT_IF_UPDATED" )
if ($Updates -gt 0)
#Reboot the server when updates are installed
boot-server
elseif ($rebootOption -eq "REBOOT")
#reboot the server always
boot-server
else
#Do not reboot the server
logger "Do not reboot the server" $logfile
Log-scriptEnd $MyInvocation.MyCommand.Name $logfile
exit 0 -
Installing SQL Server 2012 remotely via Powershell using Invoke-Command
I am trying to perform a SQL Server 2012 command line installation using Powershell Invoke-Command on Windows 2012 Datacenter.
The code I am using is as follows:
$ret = Invoke-Command -ComputerName $COMPUTER -ArgumentList $MEDIA,$ACTION,$FEATURES,$INSTALLDIR,$INSTANCEID,$INSTANCENAME,$SQLDATADRIVE,$SQLLOGDRIVE,$DOMAIN,$SQLSERVERSERVICEUSER,$SQLSERVICEPASSWORD,$PRODUCTKEY,$SQLSERVERSA,$username,$ADMINPASSWD
-Credential $cred -ScriptBlock {
param($MEDIA,
$ACTION,
$FEATURES,
$INSTALLDIR,
$INSTANCEID,
$INSTANCENAME,
$SQLDATADRIVE,
$SQLLOGDRIVE,
$DOMAIN,
$SQLSERVERSERVICEUSER,
$SQLSERVICEPASSWORD,
$PRODUCTKEY,
$SQLSERVERSA,
$USERNAME,
$PASSWD)
Set-Location $MEDIA
Import-Module ServerManager
if (-not [IO.Directory]::Exists($MEDIA)){
$hn = hostname
return 0,"Failed to find SQL Server Installer at $MEDIA on $hn"
$tran = ""
Try{
& $MEDIA\setup.exe /ACTION=$ACTION /Q /FEATURES=$FEATURES /IACCEPTSQLSERVERLICENSETERMS /UPDATEENABLED=False /INSTALLSHAREDDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /INSTALLSHAREDWOWDIR="$INSTALLDIR\Program Files
(x86)\Microsoft SQL Server" /RSINSTALLMODE="FilesOnlyMode" /INSTANCEID="$INSTANCEID" /INSTANCENAME="$INSTANCENAME" /INSTANCEDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /ENU="True" /AGTSVCSTARTUPTYPE="Automatic"
/SQLSVCSTARTUPTYPE="Automatic" /NPENABLED=1 /TCPENABLED=1 /RSSVCStartupType="Automatic" /ERRORREPORTING=0 /SQMREPORTING=0 /INDICATEPROGRESS /INSTALLSQLDATADIR="$SQLDATADRIVE\DATA" /SQLUSERDBDIR="$SQLDATADRIVE\DATA" /SQLUSERDBLOGDIR="$SQLLOGDRIVE\LOG"
/ASDATADIR="$SQLDATADRIVE\OLAP\DATA" /ASLOGDIR="$SQLLOGDRIVE\OLAP\Log" \ASBACKUPDIR="$SQLDATADRIVE\OLAP\Backup" \ASTEMPDIR="$SQLDATADRIVE\OLAP\Temp" /ASCONFIGDIR="$SQLDATADRIVE\OLAP\Config" /ASCOLLATION="Latin1_General_CI_AS"
/SQLCOLLATION="SQL_Latin1_General_CP1_CS_AS" /SQLSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /SQLSVCPASSWORD="$SQLSERVICEPASSWORD" /AGTSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /AGTSVCPASSWORD="$SQLSERVICEPASSWORD"
/ASSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /ASSVCPASSWORD="$SQLSERVICEPASSWORD" /RSSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /RSSVCPASSWORD="$SQLSERVICEPASSWORD" /FTSVCACCOUNT="NT AUTHORITY\LOCAL SERVICE"
/INDICATEPROGRESS > $out
} Catch [System.Exception] {
return 0,$_.Exception.ToString()
if ($tran -ne ""){
$out += $tran
return 1,$out
The media resides on the server that I am remoting to in powershell and the server is on the same domain. The credentials I pass are for a Domain Admin, but SQL Server fails to validate the credentials for the passed parameter for the sql service user with
a Access Denied.
If I run the same command with the same user directly on the server it works fine.
My guess is that the elavated privs for Administrator are not being set when using Invoke-Command? Is there a way to utilize powershell to install SQL Server 2012 with command line option using the invoke-command and passing credentials? Or is this a limitation
to the SQL Server installer. If there is can a example be provided?Ok, so with the help of some friends, we found a fix that works!
Prior to running the Invoke-Command I now run:
# enable CredSSP on a client computer; this command allows the client credentials to be delegated to the server01 computer.:
Enable-WsManCredSSP -Role Client -DelefateComputer server.some.domain.com
Then I add the -Authentication option to my Invoke-Command with option Credssp.
The install the works fine. Hope this helpes all. -
Hi I am a PS virgin so be gentle with me. I am trying to run the vssadmin list writers command on 8 servers.
invoke-command -computername srv-bx-hvc1, srv-bx-hvc2, srv-bx-hvc3, srv-bx-hvc4,
srv-bx-hvc5,
srv-bx-hvc6,
srv-bx-hvc7, srv-bx-hvc8
-command {vssadmin list writers}
The command works but I cannot tell which response is from what server.
The objective whould be to eventually have the command so I know which server has failed vss writers if possible restart them automatically.
Any thoughts on how to achieve this lofty ideal??
ThanksThis is a tweak to the example that JRV listed. I am using this code to just pull the information about the Exchange Writers but you could adapt it for others.
$servers='sdcexmail001','sdcexmail002','sdcexmail003','sdcexmail004','sdcexmail005'
$servers | %{
$sb={
$writers=vssadmin list writers
New-Object PSObject -Property @{Server=$_;Writers=$writers}
$ServerName = $_
$out = invoke-command -computername $_ -scriptblock $sb -Argumentlist $_
$WritersData = $Out.Writers
for ($I = 0;$I -le $WritersData.Count -1;$I++)
$Data = $WritersData[$I]
If($Data.StartsWith('Writer name:'))
$WriterName = ($Data.Split(':')[1]).Trim()
$WriterID = ($WritersData[$I+1].Split(':')[1]).Trim()
$WriterInstID = ($WritersData[$I+2].Split(':')[1]).Trim()
$State = ($WritersData[$I+3].Split(':')[1]).Trim()
$LastError = ($WritersData[$I+4].Split(':')[1]).Trim()
$info = [Ordered]@{
'ComputerName' = "$ServerName";
'WriterName' = "$WriterName";
'WriterID' = "$WriterID";
'WriterInstID' = "$WriterInstID";
'State' = "$State";
'LastError' = "$LastError";
$object = New-Object -TypeName psobject -Property $info
$object | Where-Object {$_.WriterName -like '*Microsoft Exchange*'} | Select-Object -Property ComputerName,WriterName,State,LastError -
Suppress file deletion confirmation on remote server in Invoke-Command
Hi!
I try create function used for removing folders (and all content) on remote servers .
$FullPathToDelete="\\"+("$Computername\$BasePath\$FolderToDelete").Replace("\\","\")
if (Test-Path $FullPathToDelete -pathType container ) {
$ScriptBlockContent = {
paramater($FullPathToDeleteLocal)
Get-ChildItem -Path $FullPathToDeleteLocal -Recurse | Remove-Item -Force $true -Recurse $true -Confirm:$false | Out-Null
Invoke-Command -Computername $Computername -ScriptBlock $ScriptBlockContent -ArgumentList $FullPathToDelete -AsJob
Remove-Item -Path $FullPathToDelete -Force | Out-Null
Example values for variables
$Computername = "SPPL09281"$BasePath="D$"$FolderToDelete="FolderName"
All work but for every computer (I use this code in a loop) I receive additional prompt for confirmation
Id Name State HasMoreData Location Command
11 Job11 Running True SPPL09281 ...Confirm
The item at Microsoft.PowerShell.Core\FileSystem::\\SPPL09281\D$\FolderName has children and the Recurse
parameter was not specified. If you continue, all children will be removed with the item. Are you sure you want to
continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
How I can avoid these confirmation prompts?
Thank you in advance.
Wojciech SciesinskiHi Wojciech,
In addition, The original confirm is reminding the folder you want to delete has subfiles, please try to add -recurse parameter:
$FullPathToDelete="\\"+("$Computername\$BasePath\$FolderToDelete").Replace("\\","\")
if (Test-Path $FullPathToDelete -pathType container ) {
$ScriptBlockContent = {
paramater($FullPathToDeleteLocal)
Get-ChildItem -Path $FullPathToDeleteLocal -Recurse | Remove-Item -Force -Recurse -Confirm:$false | Out-Null
Invoke-Command -Computername $Computername -ScriptBlock $ScriptBlockContent -ArgumentList $FullPathToDelete -AsJob
Remove-Item -Path $FullPathToDelete -Recurse -Force
If there is anything else regarding this issue, please feel free to post back.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support -
How to tell client disconection reason when invoke disconnect() on the server side.
Is there any way to tell client the reason for disconect when I call disconect() on the server side. its some way like using error object as optional parameter to include reject reason when invode rejectConnection
Ignore the JSRs for now.
Follow the JavaEE tutorial.
http://docs.oracle.com/javaee/6/tutorial/doc/
The answers to many of your questions will be clear to you once you have completed the tutorial.
I also like the tutorials here (they are a little dated, but still mostly relevant as the core JEE6 specs that the tutorial relies on were released over 5 years ago and JEE7 is yet to be released).
https://schuchert.wikispaces.com/EJB+3+and+Java+Persistence+API
zonski has a spring+javafx focused tutorial if you would prefer to learn and use Spring than JEE (they are differing technologies which cover pretty much the same functional set):
http://www.zenjava.com/series/building-jee-applications-in-javafx-2-0/
JavaFX is a client side framework so there is not much you would do with it on the server side.
It seems like there is a ton of "JSR's" for different tasks, and I'm not sure exactly what I need, and all that, so I'm really confusedNobody needs all of JEE, just use the bits that you want that are a good fit for whatever project you are doing - don't try to use everything at once.
A lot of the stuff can be learnt and used in isolation.
Selected relevant topics, might be (in the order that I would consider them):
Persistence: http://docs.oracle.com/javaee/6/tutorial/doc/bnbpy.html
Java Servlet Technology: http://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html
JAX-RS web services: http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
Contexts and Dependency Injection: http://docs.oracle.com/javaee/6/tutorial/doc/gjbnr.html
Enterprise Beans: http://docs.oracle.com/javaee/6/tutorial/doc/bnblr.html -
Hi,
I am deplyoing a solution which has custom web parts- vwp- appln pages, event receivers.
It was working fine till last week. I was able to deploy the solution and able to see the web parts and func. was working.
But now from the last 2 days onwards, when I tried to depoy this soution, I am getting the error
"Error occurred in deployment step 'Add Solution': A timeout has occurred while invoking commands in SharePoint host process "
may i know why am getting this error.
note: my dev machine- Win Srvr 2012 - VS 2012- SP 2013 - SP D 2013 was having soem issues with the space in C drive.
once i have done the index reset few months back and i started getting space in C:\ Drive is 0 bytes.
so what my infra. team has done is , increased the space in drive to 150 GB[ it was a VM ].
help is appreciated !What is current disk space on your drives
Delete ULS logs and other log files from server id not needed
could be related to ChannelOperationTimeout
http://msdn.microsoft.com/en-us/library/ee471440(v=vs.100).aspx
Also, don't forget to restart Visual Studio
Goto the following regustry key: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SharePointTools
Add the following as a DWORD (wont be there by default)
ChannelOperationTimeout
REG_DWORD that specifies the time, in seconds, that Visual Studio waits for a SharePoint command to execute. If the command does not execute in time, a SharePointConnectionException is thrown.
The default is 120 seconds.
http://social.technet.microsoft.com/wiki/contents/articles/21052.como-resolver-o-erro-error-occurred-in-deployment-step-activate-features-a-timeout-has-occurred-while-invoking-commands-in-sharepoint-host-process-pt-br.aspx
If this helped you resolve your issue, please mark it Answered -
A communication error has occurred while invoking commands in SharePoint host process
Hi All,
I am using Virtual box to connect to Sharepoint 2013 VPC. Due to an unexpected sutdown of my machine the VPC got some issue. Now I restored it using my bak up file. But after this when I deploy my sharepoint 2013 farm solution Iam getting the following error.
Error occurred in deployment step 'Recycle IIS Application Pool': A communication error has occurred while invoking commands in SharePoint host process: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature
session shutdown or an internal server error.
What could be the issue? Any suggestions ?
Thanks in advance...
Regards
Nimisha
[email protected]Hi Nimisha,
Seems that the original issue of communication error has been solved, for this new issue, it is recommended that you open a new thread which can make others easier
to focus on one issue in one single thread.
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
JDeveloper - Error when trying to create an application server connection
Hello everyone,
I am trying to use JDeveloper to create a connection an Oracle WebLogic Server configured for Oracle SOA Suite. When I navigate to Connections and click on Application Server Connection, JDeveloper produces and error with the diagnostics shown below. I'm new to using JDeveloper so any help or advice on how to start to resolve this issue would be greatly appreciated. Fore the record I'm using JDeveloper 11G R2 (11.1.2.1.0) running on a Linux Red Hat 5 64 bit server.
Performing action (39) Close All [ from ] [ for ( <none>, MasterBuildScript.jpr, Infrastructure.jws ) ]
Performing action (272) New Application... [ from ExplorerWindowImpl ] [ for ( <none>, MasterBuildScript.jpr, Infrastructure.jws ) ]
Invoking command: [ from ExplorerWindowImpl ] [ for ( <none>, MasterBuildScript.jpr, Infrastructure.jws ) ]
18-Oct-2011 10:37:02 oracle.adfinternal.rc.connection.AdfConnectionContextProvider getConnectionContext()
SEVERE:
oracle.adf.rc.exception.CatalogRuntimeException: error while obtaining a connection context using connection context provider [oracle.adfinternal.rc.connection.AdfConnectionContextProvider] Root Cause=[]
at oracle.adfinternal.rc.connection.AdfConnectionContextProvider.getConnectionContext(AdfConnectionContextProvider.java:92)
at oracle.adfinternal.rc.connection.ConnectionManagerImpl.getConnections(ConnectionManagerImpl.java:385)
at oracle.jdeveloper.rescat2.model.registry.RescatContext.getConnectionContext(RescatContext.java:220)
at oracle.jdeveloper.rcasadapter.rescat2.RescatContextStore.<init>(RescatContextStore.java:56)
at oracle.jdeveloper.asnav.wizard.RescatAppServerWizard.setResourcePaletteStore(RescatAppServerWizard.java:99)
at oracle.jdeveloper.asnav.wizard.RescatAppServerWizard.createWizardControl(RescatAppServerWizard.java:87)
at oracle.jdeveloper.rcasadapter.wizard.AppServerProviderWizard.invoke(AppServerProviderWizard.java:93)
at oracle.ide.wizard.WizardManager.invokeWizard(WizardManager.java:446)
at oracle.ide.wizard.WizardManager$1.run(WizardManager.java:530)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:603)
at java.awt.EventQueue$1.run(EventQueue.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at oracle.adfinternal.rc.connection.UncloseableContextWrapper.wrapContext(UncloseableContextWrapper.java:59)
at oracle.adfinternal.rc.connection.AdfConnectionContextProvider.getConnectionContext(AdfConnectionContextProvider.java:79)
... 24 more
oracle.adf.rc.exception.CatalogRuntimeException: error while obtaining a connection context using connection context provider [oracle.adfinternal.rc.connection.AdfConnectionContextProvider] Root Cause=[]
o.adfinternal.rc.connection.AdfConnectionContextProvider.getConnectionContext(AdfConnectionContextProvider.java:92)
o.adfinternal.rc.connection.ConnectionManagerImpl.getConnections(ConnectionManagerImpl.java:385)
o.j.rescat2.model.registry.RescatContext.getConnectionContext(RescatContext.java:220)
o.j.rcasadapter.rescat2.RescatContextStore.<init>(RescatContextStore.java:56)
o.j.asnav.wizard.RescatAppServerWizard.setResourcePaletteStore(RescatAppServerWizard.java:99)
o.j.asnav.wizard.RescatAppServerWizard.createWizardControl(RescatAppServerWizard.java:87)
o.j.rcasadapter.wizard.AppServerProviderWizard.invoke(AppServerProviderWizard.java:93)
o.i.wizard.WizardManager.invokeWizard(WizardManager.java:446)
o.i.wizard.WizardManager$1.run(WizardManager.java:530)
j.a.event.InvocationEvent.dispatch(InvocationEvent.java:209)
j.a.EventQueue.dispatchEventImpl(EventQueue.java:642)
j.a.EventQueue.access$000(EventQueue.java:85)
j.a.EventQueue$1.run(EventQueue.java:603)
j.a.EventQueue$1.run(EventQueue.java:601)
j.security.AccessController.doPrivileged(Native Method)
j.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
j.a.EventQueue.dispatchEvent(EventQueue.java:612)
o.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
o.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
j.a.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by:
java.lang.NullPointerException
o.adfinternal.rc.connection.UncloseableContextWrapper.wrapContext(UncloseableContextWrapper.java:59)
o.adfinternal.rc.connection.AdfConnectionContextProvider.getConnectionContext(AdfConnectionContextProvider.java:79)
o.adfinternal.rc.connection.ConnectionManagerImpl.getConnections(ConnectionManagerImpl.java:385)
o.j.rescat2.model.registry.RescatContext.getConnectionContext(RescatContext.java:220)
o.j.rcasadapter.rescat2.RescatContextStore.<init>(RescatContextStore.java:56)
o.j.asnav.wizard.RescatAppServerWizard.setResourcePaletteStore(RescatAppServerWizard.java:99)
o.j.asnav.wizard.RescatAppServerWizard.createWizardControl(RescatAppServerWizard.java:87)
o.j.rcasadapter.wizard.AppServerProviderWizard.invoke(AppServerProviderWizard.java:93)
o.i.wizard.WizardManager.invokeWizard(WizardManager.java:446)
o.i.wizard.WizardManager$1.run(WizardManager.java:530)
j.a.event.InvocationEvent.dispatch(InvocationEvent.java:209)
j.a.EventQueue.dispatchEventImpl(EventQueue.java:642)
j.a.EventQueue.access$000(EventQueue.java:85)
j.a.EventQueue$1.run(EventQueue.java:603)
j.a.EventQueue$1.run(EventQueue.java:601)
j.security.AccessController.doPrivileged(Native Method)
j.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
j.a.EventQueue.dispatchEvent(EventQueue.java:612)
o.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
o.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
j.a.EventDispatchThread.run(EventDispatchThread.java:122)
Thanks,
Shaun.Not sure if this is a cause for your error, but JDev11.1.2.1.0 doesn't work with SOA right now. For SOA you need to use jdev11.1.1.5.0 or lower.
Timo -
Invoke-command takes 20-90 seconds to complete
all servers I'm testing with is server 2008r2 with powershell 4. I have a text file with 100 servers that are online and with PS remoting enabled.
When I run this command:
# this takes about 20-30 seconds to complete
Invoke-Command
-ScriptBlock
{get-date}
-ComputerName
(gc
100servers.txt)
# this takes at least 90 seconds to complete when I set throttle to 100
Invoke-Command
-ScriptBlock
{get-date}
-ComputerName
(gc
100servers.txt)
-ThrottleLimit
100
I didn't get these delays when my local was running powershell 2 and executing against the same set of servers with PS4 on them. PS2 only took 2-3 seconds to finish the command if all were online. If I run the command in PS4 ISE, it seems to
work fast as well but for some reason PS4 traditional shell (not ISE) gives me these delays when working with large set of servers and increasing throttle to 100+
Sometimes you get different results if you keep running it with the same shell, but if you open a new shell with -noprofile switch then I get the same execution delays with PS4.
# I even tried skipping the different checks with sessionOption below but same results
Invoke-Command
-ScriptBlock
{get-date}
-ComputerName
(gc
100servers.txt)
-ThrottleLimit
100
-SessionOption
(New-PSSessionOption
-SkipCACheck
-SkipRevocationCheck
-SkipCNCheck)
I also tried running the same command from win8.1 with PS4 and it will hang for about 90 seconds before it spits out all the results at once.
This seems to be a problem with large number of servers of at least 50. Works fine with small set. Is anyone else having this problem? I know there's other ways of running scripts in parallel, but I can't figure out why this is not working.
I'm also using the default pssessionoption below. I have full admin rights to all the servers. Any suggestions?
MaximumConnectionRedirectionCount : 5
NoCompression : False
NoMachineProfile : False
ProxyAccessType : None
ProxyAuthentication : Negotiate
ProxyCredential :
SkipCACheck : False
SkipCNCheck : False
SkipRevocationCheck : False
OperationTimeout : 00:03:00
NoEncryption : False
UseUTF16 : False
IncludePortInSPN : False
OutputBufferingMode : None
Culture :
UICulture :
MaximumReceivedDataSizePerCommand :
MaximumReceivedObjectSize :
ApplicationArguments :
OpenTimeout : 00:03:00
CancelTimeout : 00:01:00
IdleTimeout : -00:00:00.0010000-asjob only puts it in the background, but it still takes the same amount of time to finish. Any other suggestions? I want to be able to increase the throttle to at least 100 servers. With PS2, I was able to throttle to 200 servers and
was very fast. Not sure why PS4 is so much slower. It seems to run better without increasing the throttle, but still slower when dealing with 100 servers compared to PS2 results.
Invoke-Command
-ScriptBlock
{get-date}
-ComputerName
(gc
100servers.txt)
-ThrottleLimit
100 -
Invoke-Command & Add-CMDistributionPoint - Certificate failure
Hi together,
for automatic creation of Distribution Points I am doing the following things.
Doing this locally on the Primary Site Server as Network Access Account everything works fine.
But when I try to do this with invoke-command on my machine with Network Access Account too, I'll get an error:
WARNING: The self signed certificate could not be created successfully.
What am I doing wrong?
Here is what I am doing locally:
Write-Host "------------------NOW Running on REMOTE Primary Site----------------" -BackgroundColor Yellow -ForegroundColor Black
if(!(Test-Path $RemoteSCCMModule))
Write-Error "Could not find Remote SCCM Module!"
Exit
Write-Debug "Importing SCCM Module..."
Import-Module $RemoteSCCMModule -Force
$SiteLocation = $SiteCode + ":"
Set-Location $SiteLocation | Out-Null
if(($BoundaryName -ne "") -and ($BoundaryName -ne " ") -and ($BoundaryName -ne $null) -and ($BoundaryName -ne $false))
$BoundaryValue = $BoundaryStartIP + "-" + $BoundaryEndIP
New-CMBoundary -DisplayName $BoundaryName -BoundaryType IPRange -Value $BoundaryValue
New-CMBoundaryGroup -Name $BoundaryGroupName
Add-CMBoundaryToGroup -BoundaryGroupName $BoundaryGroupName -BoundaryName $BoundaryName
New-CMSiteSystemServer -ServerName $using:NewDPServer -SiteCode $using:SiteCode
Start-Sleep -Seconds 2
Add-CMDistributionPoint -SiteSystemServerName $NewDPServer -SiteCode $SiteCode -MinimumFreeSpaceMB $MinimumFreeDiskSpace -EnablePxeSupport -AllowRespondIncomingPxeRequest -EnableUnknownComputerSupport -ComputersUsePxePassword $PXEPassword -UserDeviceAffinity DoNotUse -PxeServerResponseDelaySeconds 5 -CertificateExpirationTimeUtc $CertExpirationDate
Start-Sleep -Seconds 2
Foreach($DPGroup in $NewDPServer_Groups)
Add-CMDistributionPointToGroup -DistributionPointGroupName $DPGroup -DistributionPointName $NewDPServer
And this is what I am doing with Invoke-Command:
Invoke-Command -ComputerName $PrimarySiteServer -ConfigurationName Microsoft.PowerShell32 -Credential $NAACred -ScriptBlock {
$DebugPreference = $using:DebugPreference
Write-Host "------------------NOW Running on REMOTE Primary Site----------------" -BackgroundColor Yellow -ForegroundColor Black
Write-Debug "Importing SCCM Module..."
Import-Module $using:RemoteSCCMModule -Force
$SiteLocation = $using:SiteCode + ":"
Set-Location $SiteLocation | Out-Null
if(($using:BoundaryName -ne "") -and ($using:BoundaryName -ne " ") -and ($using:BoundaryName -ne $null) -and ($using:BoundaryName -ne $false))
$BoundaryValue = $using:BoundaryStartIP + "-" + $using:BoundaryEndIP
New-CMBoundary -DisplayName $using:BoundaryName -BoundaryType IPRange -Value $BoundaryValue
New-CMBoundaryGroup -Name $using:BoundaryGroupName
Add-CMBoundaryToGroup -BoundaryGroupName $using:BoundaryGroupName -BoundaryName $using:BoundaryName
New-CMSiteSystemServer -ServerName $using:NewDPServer -SiteCode $using:SiteCode
Start-Sleep -Seconds 2
Add-CMDistributionPoint -SiteSystemServerName $using:NewDPServer -SiteCode $using:SiteCode -MinimumFreeSpaceMB $using:MinimumFreeDiskSpace -EnablePxeSupport -AllowRespondIncomingPxeRequest -EnableUnknownComputerSupport -ComputersUsePxePassword $using:PXEPassword -UserDeviceAffinity DoNotUse -PxeServerResponseDelaySeconds 5 -CertificateExpirationTimeUtc $using:CertExpirationDate
Start-Sleep -Seconds 2
Foreach($DPGroup in $using:NewDPServer_Groups)
Add-CMDistributionPointToGroup -DistributionPointGroupName $DPGroup -DistributionPointName $using:NewDPServer
If you need more information what different valus of variables are i can provide.
Thank you.
Kind regards
Martin KrämerHi,
Here is the whole script - I'm still testing around this is why it is not really nice at the moment ;-) :
$DebugPreference = "Continue"
$Script:Script= $MyInvocation.MyCommand.Definition
$Script:DebugOut = "Script started: " + "$Script:Script"
Write-Debug $Script:DebugOut
$Script:ScriptPath = Split-Path -Path $Script:Script -Parent
$CertExpirationDate = (Get-Date).AddYears(100)
#region Setting_Variables
$NAACred = Get-Credential -Message "provide NetworkAccessAccount credentials:" -UserName "test.loc\NAA_User"
[string]$RemoteSCCMModule = "D:\ConfigMgr\AdminConsole\bin\ConfigurationManager.psd1"
[string]$PrimarySiteServer = "Test-Primary"
[string]$SiteCode = "KN1"
[string]$NewDPServer = "TEST-DP.test.loc"
$PXEPassword = ConvertTo-SecureString -AsPlainText "mypass" -Force
[int]$MinimumFreeDiskSpace = 2000
[string]$BoundaryName = " "
[string]$BoundaryStartIP = "192.168.30.1"
[string]$BoundaryEndIP = "192.168.30.254"
[string]$BoundaryGroupName = "TEST-DP_Group"
[array]$NewDPServer_Groups = "04 All Aviable DPs", "01 All PXE DPs"
#endregion Setting_Variables
#region REMOTE PrimarySiteServerScript
<#
IF ($env:PROCESSOR_ARCHITECTURE -ne "x86")
Write-Debug "Powershell needs to be in x86 mode. Restarting powershell..."
$PS32exe = "$env:windir\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
if(!(Test-Path $PS32exe))
Write-Error "x86 Powershell not found!"
exit
$powershell = [System.Diagnostics.Process]::GetCurrentProcess()
$psi = New-Object System.Diagnostics.ProcessStartInfo $powerShell.Path
$script = $MyInvocation.MyCommand.Path
$prm = $script
foreach($a in $args)
$prm += ' ' + $a
$psi.Arguments = $prm
$psi.FileName = $PS32exe
[System.Diagnostics.Process]::Start($psi) | Out-Null
exit
Else
Write-Debug "Powershell already in x86 mode..."
if(!(Test-Path $using:RemoteSCCMModule))
Write-Error "Could not find Remote SCCM Module!"
Exit
#>
<#
Invoke-Command -ComputerName $PrimarySiteServer -ConfigurationName Microsoft.PowerShell32 -Credential $NAACred -ScriptBlock {
$DebugPreference = $using:DebugPreference
Write-Host "------------------NOW Running on REMOTE Primary Site----------------" -BackgroundColor Yellow -ForegroundColor Black
Write-Debug "Importing SCCM Module..."
Import-Module $using:RemoteSCCMModule -Force
$SiteLocation = $using:SiteCode + ":"
Set-Location $SiteLocation | Out-Null
if(($using:BoundaryName -ne "") -and ($using:BoundaryName -ne " ") -and ($using:BoundaryName -ne $null) -and ($using:BoundaryName -ne $false))
$BoundaryValue = $using:BoundaryStartIP + "-" + $using:BoundaryEndIP
New-CMBoundary -DisplayName $using:BoundaryName -BoundaryType IPRange -Value $BoundaryValue
New-CMBoundaryGroup -Name $using:BoundaryGroupName
Add-CMBoundaryToGroup -BoundaryGroupName $using:BoundaryGroupName -BoundaryName $using:BoundaryName
New-CMSiteSystemServer -ServerName $using:NewDPServer -SiteCode $using:SiteCode
Start-Sleep -Seconds 2
Add-CMDistributionPoint -SiteSystemServerName $using:NewDPServer -SiteCode $using:SiteCode -MinimumFreeSpaceMB $using:MinimumFreeDiskSpace -EnablePxeSupport -AllowRespondIncomingPxeRequest -EnableUnknownComputerSupport -ComputersUsePxePassword $using:PXEPassword -UserDeviceAffinity DoNotUse -PxeServerResponseDelaySeconds 5 -CertificateExpirationTimeUtc $using:CertExpirationDate
Start-Sleep -Seconds 2
Foreach($DPGroup in $using:NewDPServer_Groups)
Add-CMDistributionPointToGroup -DistributionPointGroupName $DPGroup -DistributionPointName $using:NewDPServer
#>
#endregion REMOTE PrimarySiteServerScript
#region LOCAL PrimarySiteServerScript
Write-Host "------------------NOW Running on REMOTE Primary Site----------------" -BackgroundColor Yellow -ForegroundColor Black
if(!(Test-Path $RemoteSCCMModule))
Write-Error "Could not find Remote SCCM Module!"
Exit
Write-Debug "Importing SCCM Module..."
Import-Module $RemoteSCCMModule -Force
$SiteLocation = $SiteCode + ":"
Set-Location $SiteLocation | Out-Null
if(($BoundaryName -ne "") -and ($BoundaryName -ne " ") -and ($BoundaryName -ne $null) -and ($BoundaryName -ne $false))
$BoundaryValue = $BoundaryStartIP + "-" + $BoundaryEndIP
New-CMBoundary -DisplayName $BoundaryName -BoundaryType IPRange -Value $BoundaryValue
New-CMBoundaryGroup -Name $BoundaryGroupName
Add-CMBoundaryToGroup -BoundaryGroupName $BoundaryGroupName -BoundaryName $BoundaryName
New-CMSiteSystemServer -ServerName $using:NewDPServer -SiteCode $using:SiteCode
Start-Sleep -Seconds 2
Add-CMDistributionPoint -SiteSystemServerName $NewDPServer -SiteCode $SiteCode -MinimumFreeSpaceMB $MinimumFreeDiskSpace -EnablePxeSupport -AllowRespondIncomingPxeRequest -EnableUnknownComputerSupport -ComputersUsePxePassword $PXEPassword -UserDeviceAffinity DoNotUse -PxeServerResponseDelaySeconds 5 -CertificateExpirationTimeUtc $CertExpirationDate
Start-Sleep -Seconds 2
Foreach($DPGroup in $NewDPServer_Groups)
Add-CMDistributionPointToGroup -DistributionPointGroupName $DPGroup -DistributionPointName $NewDPServer
#endregion LOCAL PrimarySiteServerScript
Thank you for help :-) -
Invoke-command for msiexec hangs
Hi,
I'm running a client of Windows 8 Pro against a server of Win2012R2
I have the following script:
$args = "-i `"$MSIPathFile`" INSTALLDIR=`"$InstallFolderOnTargetServer`" /qn /norestart"
LogInfo "args: $args"
$Session = EstablishSession $TargetServer $CommonPowershellScriptPath
try
#Invoke-Command -session $Session -ScriptBlock{param($arguments) start-process -FilePath "msiexec.exe" -Wait $arguments } -Argument $arguments
#winrs -r:$TargetServer msiexec.exe $arguments
$script = {
#do preinstall stuff
[diagnostics.process]::start("c:\windows\system32\msiexec.exe", $args).WaitForExit()
#do follow up stuff
invoke-command -session $Session -scriptblock $script
When the invoke-command line is executed, I get no response - I've waited for 10 minutes!
I've checked the event log on the server and client and there's nothing. I know the $Session variable holds a good session because it works with this elsewhere in the script. The credential used by this is a domain account that is a member of the local administrators
group on the target server
If I take the content of $args and run this with msiexec directly on the server then the msi silently installs in about 15 seconds.
I have followed the instructions here in order to Enable-PsWsmanCombinedTrace (http://windowsitpro.com/blog/troubleshooting-winrm-and-powershell-remoting-part-1) but
the only error I see is within the "Windows Remote Management\Operational" log:
WSMan operation SignalShell failed, error code 2150858793
I think this could be caused when I force the debugger to stop - so could be a red herring.
This same script has worked well in the past, though that was different servers and network.
Any suggestions as to what else I can try in order to get the MSI to install remotely?Not all MSIs will install unattended. It is pretty certian a message is being shown and stoipping the install. Check with the vendor to be sure they support full unattended installs.
¯\_(ツ)_/¯ -
Invoke-Command Set-Item wsman : Access Denied
Hi,
I'm trying to write a script that run another script via an Invoke-Command cmdlet. This script is :
$usrname = "[email protected]"
$pwd = "MonPassword"
$pwd = ConvertTo-SecureString -AsPlainText $pwd -Force
$cred1 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $usrname, $pwd
Invoke-Command -ComputerName "SRVFWL" -FilePath "c:\Scripts\VPNScript.ps1" -Credential $cred1
So this first script run the next script with the user [email protected] :
$ID = "UserID"
$RCMPUSR = "UsrOnVpnCmp"
$RCMPPWD = "MyPass"
$RCMPPWD = ConvertTo-SecureString -AsPlainText $RCMPPWD -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $RCMPUSR, $RCMPPWD
#Connection to RRAS TMG 2010
$root = New-Object -ComObject "FPC.Root"
$isaarray = $root.GetContainingArray()
$sessionmonitor = $isaarray.SessionsMonitors.SessionsMonitorFirewall
$filter = New-object -ComObject FPC.FPCFilterExpressions
#Retreive VPN session
$sessionmonitor.ExecuteQuery($filter,10000)
#Check session
foreach($session in $sessionmonitor)
if($session.ClientIP.StartsWith("10.10."))
if($session.ClientUserName -eq "MYDOM\\"+$ID)
Set-Item wsman:\localhost\client\trustedhosts $session.ClientIP -Force
If((Test-WSMan $session.ClientIP).IsEmpty -eq $false)
$CMPName = Invoke-Command -ComputerName $session.ClientIP -ScriptBlock {$(Get-WmiObject Win32_Computersystem).name} -credential $cred
$Version = Invoke-Command -ComputerName $session.ClientIP -ScriptBlock {[Environment]::OSVersion.Version} -credential $cred
If($Version.Major -eq 6)
$sessionmonitor.DisconnectSession("MyTMGServer",$session.SessionID)
$usr = $ID + "@mydom.pri"
netsh ras set client $usr disconnect
return $true
$sessionmonitor.EndQuery()
This second script run greatly when I run it manually on the local server connected with the svc_scripts user. But I've a Access Denied on the Set-Item cmdlet of the second script when i try to run it with the Invoke-Command.
I don't understand why this same user are allowed to run the script locally but not allowed on remote computer.
Can you help me ?
Thank you.Hi Judicael44,
First You will encounter the second-hop issue when run "invoke-commmand" as the scriptblock in another remote cmdlet, for more detailed information, please refer to this article:
Enabling Multihop Remoting
For the error you posted, Let me restate this issue, we have two servers:
Local server: server1
remote server: SRVFWL
So the second script is located on server1, and the user "[email protected]" has admin right on server
SRVFWL, you got the error "access denied" when ran the script on remote server SRVFWL.
In this case, please make sure you have ran the cmdlet "Enable-PSRemoting -Force" on server SRVFWL, which will give you the rights to access and modify TrustedHosts setting in WinRm.
I tested with single cmdlet, and this could work:
If there is anything else regarding this issue, please feel free to post back.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support
Maybe you are looking for
-
Shuffle causes Windows to stop recognizing all other USB ports!?!
When I plug my new Shuffle in to any USB Port, Windows stops recognizing all other USB drives. (this includes my internet connection and external hard drive with all music) If I disconnect the Shuffle and repower the other devices, they work normally
-
QA32 UD for Handling Units results in a transfer posting delivery?
In our environment we have Handling Units, Serial Numbers and QM. In the mateial master the QM inspection types are set to inspecting by HU. The inspection lot gets created correctly and it references all the HUs. When we perform a usage decision
-
Dear All, My blackberry is: 8520 OS: V5.0.0.822 I would like to received emails in HTML format. How to do that? please help! I have unlimited data plan Regards, Yazen
-
Transfer from all countries online number ($18/3 m...
Hi, Please guide me how to transfer from 'ALL countries online to US /Canada online number' - as it was an error and I don't have to pay $18 where the transaction is still pending - please help me to transfer to US online and to refund the balance or
-
Not all photos showing on iPhone 4s
Hello, All of my photos are showing on my Windows PC in the "My Photo Stream" however, only 32 of those are showing on my iPhone 4s. Thanks a lot! Jonathon Provost