Starting WPF from remote PowerShell - wpf

I want to open a WPF application from remote machine using PowerShell.
This is the command I'm using
Invoke-Command -ComputerName "ComputerNamne" -ScriptBlock { & "C:\...App.exe" } -credential "Username"
but for some reason nothing happens
I was able to start the process when calling batch file which calls the applcation
Invoke-Command -ComputerName "ComputerNamne" -ScriptBlock { & "C:\...RubApp.bat" } -credential "Username"
but in this way the GUI is not appearing. I can see in task manager that the app is running though.
So two questions:
Why can't I run directly the exe file?
Why the GUI is hidden in the second method. Can I solve this?

For invoking GUI app , you have to use PSexec with -i :
You can download it from here and you will get to know how to use also.
PSTools Download
Hope it helps.

I concur with Ranadip on this one. This is not a feature of powershell, as neither WinRM nor WMI will allow you to utilize a GUI application remotely.
See a similar question:
Running remote GUI app in Powershell

Related

msonline module - where statements not working in azure functions powershell

I am trying to get a script working but any time I pipe a "where" or "Where-object" into it, I get zero results.
i.e.
$UserNames = Get-MsolUser -TenantId $tenantid -ALL | Where {($_.licenses).AccountSkuId -ilike "*$($licenseName)"} | Sort-Object DisplayName
If I run the same script locally it works perfectly fine, but just does not work in functions.
If I remove the Where statement it runs fine.
Does this need a separate syntax in azure functions, or is it a deserialization issue for MSOnline module in azure function? Not sure how to fix.
Please help
Got it working using this workaround.
https://github.com/Azure/azure-functions-powershell-worker/issues/232

Getting Error while adding File System ISE Logic App Connector

I have created an ISE Logic Apps environment, and am trying to add the FileSystem ISE connector to the Managed connectors list, as it does not appear in my default list. When I click on '+Add', I can see the File System connector in the drop down that comes up, but when I select it & click on 'Create', I get the following error:
Failed to create connector 'isefilesystem'
Operation name
Set Integration Service Environment managed API
Time stamp
Mon Jan 13 2020 16:53:24 GMT+0000 (GMT Standard Time)
Event initiated by
xxxxxxxxx#xxxx.xxx
Error code
IntergrationServiceEnvironmentManagedApiDefinitionTagsNotSupported
Message
The tags are not supported in the managed API 'isefilesystem'.
The ISE File System connector is available. The ISE File System connector will not be automatically added to the ISE, you will need to manually add it yourself. Our engineers are working on getting that automatically added with new ISE deployments.
Here are steps from the document to add it manually to the ISE :
On your ISE menu, under Settings, select Managed connectors. On the toolbar, select Add.
On the Add a new managed connector pane, open the Find connector list. Select the ISE connector that you want to use but isn't yet deployed in your ISE. Select Create.
Only ISE connectors that are eligible but not yet deployed to your ISE appear available for you to select. Connectors that are already deployed in your ISE appear unavailable for selection.
Checkout this GitHub issue as well for details.
File system connectors is not yet available in ISE. You can use the shared connector (With gateway) in a Logic app in ISE till it is available.
It is on-premises data gateway. Yes there is already a work items for this and it is in progress and will be there in near future but this timeline is subject to change. As far as new features go, we are not able to disclose much at this time.
Also you could vote up this feedback to promote this feature to be achieved quickly.
I am having problems with the ISE Create File (Preview).
I have an API Connection defined with the Root Folder setting using dot notation, e.g. 192.168.1.23, because there is a DNS issue with hybrid cloud-on-prem lookup, or so I am told.
The Logic App portal editor in Designer mode behaves strangely when configuring the folder path in the Create File action. When using the pop-out folder picker I see "The use name or password is incorrect".
I have made sure that the credentials are correct and have tested successfully via other means.
Is there a work around?
Is this a known issue?

Credential Binding does not work in Windows batch command Jenkins

I'm kind of stuck with the Jenkins credential binding.
I'm using the Bindings tab and created a secret text and the variable for the same is pwd
and I use the variable in the "Execute Windows batch command" step and I'm running the below command on a windows node.
echo password is $pwd
and the output is always literal
password is $pwd
Even printing of existing environment variables like $BUILD_NUMBER does not work.
Why isn't my secret text binding not working? Shouldn't the variable be expanded in my build step? Can anyone please point me to what is the mistake that I'm making here.
Thanks in advance!!
The var just needs to be printed as %var%.
I was using secret text to store password of sql server login and just using %var% didn't work for me
If you are using the var for password, Use it as "%var%"

Start a session in MobaXterm from batch script

When I had Windows 7, the following batch command opened MobaXterm, and inside, it opened a new tab (in addition to the home tab) that connected to a VM ('linux-server'):
start "" "C:\Program Files (x86)\MobaXterm\MobaXterm.exe" -newtab linux-server
Now, in Windows 10, the command does not work well. It opens MobaXterm, but does not open a session to the VM.
I tried to run the command from command-line, the result is the same.
My requests are:
Opening a session to the VM in MobaXterm using batch command (the "home tab" that was opened in the past is unnecessary)
I use private key to connect this session, for some reason, Moba does not save the passphrase for the private key, only the user's password. I would like to save the passphrase as well.
Thanks in advance!
From the MobaTek Blog
MobaXterm.exe -newtab ["<Command>"]:
This command can be used to start a new tab inside a running instance of MobaXterm (or start a new instance of MobaXterm if no other instance is running) and immediately execute a given MobaXterm command
So you would need to specify a ssh command to connect to your virtual machine.
You could also save the ssh connection (or any other connection type) as a "first level" bookmark and use the bookmark-command instead:
MobaXterm.exe -bookmark "<Bookmark_name>":
This command can be used to start a bookmark by specifying its name.
In your case, the command would look like this, if your bookmark would be called "linux-server"
start "" "C:\Program Files (x86)\MobaXterm\MobaXterm.exe" -bookmark linux-server
I'm providing example usage for opening mobaxterm with specific command. Below is an example of opening a MobaXterm portable Personal edition in a newtab mode with SSH and a specified username.
MobaXterm_Personal_20.6.exe -newtab "ssh -l username 192.168.1.99"

bulkupload without username/password prompt

I have a process which generates daily some data, which I would like to update to a java app running on the appengine using bulkupload, using the command:
appcfg.py upload_data
--url=http://your_app_id.appspot.com/_ah/remote_api --kind= --filename=
It works perfectly, but it always asks me for my username/password.
Is there any way to save the credentials, use certificates, to avoid the username prompt?
Add these options:
--email=
--passin
and at the end : < "your password file.txt"
Seems this technique no longer works with SDK 1.9.17. The updated docs include some new oauth2 command line options, but the instructions are rather confusing. Anyone able to use either the old passin or the new oauth2 techniques? How?

Resources