Score:-1

Remotely open PowerShell via Intune/365?

cy flag

The organisation I work for have a range of different devices, mainly laptops, Surface Go and Surface Pro. We have a number of devices that we need to physically locate at our sites for servicing and auditing. These devices are spread throughout the community in residential houses and we would like to easily locate these devices physically but done of them have GPS. I decided the easiest way to locate these is to rename the SSID's of access points in the houses to unique names associated with the houses then run netsh wlan show interfaces in order to display the SSID, this would hopefully allow us to easily figure out which house the device is located in.

Is there an easy way to remotely run PowerShell through Microsoft Intune or anything similar? Any help or other suggestions are very much appreciated.

TIA

Update

I have run winrm quickconfig on a test client followed by Enter-PSSession HOSTNAME

I'm now receiving the following error in PowerShell....

PS C:\windows\system32> Enter-PSSession -TAM-5235 Enter-PSSession : A parameter cannot be found that matches parameter name 'TAM-5235'. At line:1 char:17 + Enter-PSSession -TAM-5235 + ~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Enter-PSSession], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.EnterPSSessionCommand

PS C:\windows\system32> Enter-PSSession TAM-5235 Enter-PSSession : Connecting to remote server TAM-5235 failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:1

  • Enter-PSSession TAM-5235
  •   + CategoryInfo          : InvalidArgument: (TAM-5235:String) [Enter-PSSession], PSRemotingTransportException
      + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    
    

PS C:\windows\system32>

currently looking at Connecting to remote server failed using WinRM from PowerShell for help.

It appears I need to explore Trusted Hosts on the clients

Score:1
cy flag

It appears I can simply use the Device Diagnostics in Endpoint Manager and look at wlan-report-latest.html to see the SSID and therefore locate the device the way I want to!

What a waste of time trying to use the CLI!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.