How to update RemoteApp and Desktop Connections using Powershell?

Kato, Daiki/加藤 大貴 40 Reputation points
2025-08-08T11:43:35.09+00:00

I would appreciate it if someone could advise me on how to update a WorkResource for RemoteApp and Desktop Connections using PowerShell.

By referring to the following site:

How to set up RemoteApp and Desktop Connections in PowerShell

I was able to figure out how to create a new WorkResource via PowerShell. However, I haven’t been able to successfully update an existing WorkResource using PowerShell.

If anyone knows how to do this, I would be grateful for your guidance.

As for what I’ve tried so far:
I attempted to use rundll32.exe with the arguments "tsworkspace,TaskUpdateWorkspaces" or "tsworkspace,TaskUpdateWorkspaces2", but neither method successfully updated the WorkResource.

Thank you in advance for your support.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

Answer accepted by question author
Smith Pham 2,795 Reputation points Independent Advisor
2025-08-11T05:17:38.67+00:00

Dear Team,

You can trigger a RemoteApp and Desktop Connections update via PowerShell by calling the built-in COM API, because there’s no native PowerShell cmdlet for it.

Example:


Co
$wsMan = New-Object -ComObject "TSWorkspace.Workspace"
$wsMan.Refresh()

Or, if you have multiple feeds and want to refresh them all:


$feeds = New-Object -ComObject "Microsoft.ManagementConsole.Advanced.TSWorkspace"
$feeds.RefreshWorkspaces()

If COM isn’t available, you can also invoke the update task directly:


schtasks /run /tn "\Microsoft\Windows\Workplace Join\Automatic-Device-Join"
schtasks /run /tn "\Microsoft\Windows\RemoteApp and Desktop Connections Update\WorkSpaceUpdateTask"

That WorkSpaceUpdateTask is what tsworkspace.dll ultimately calls, and it works for existing WorkResources without re-adding them.

Best Regards,

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.