Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9216025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:19:53+00:00 2026-06-18T02:19:53+00:00

I need to convert a Powershell script to C#. The Powershell script accesses the

  • 0

I need to convert a Powershell script to C#.

The Powershell script accesses the Windows Deployment Service COM Object:

$wdsObject = New-Object -ComObject WdsMgmt.WdsManager
$wdsServer = $wdsObject.getWdsServer("Localhost")
[...]

Is it possible to access these COM Objects in C#?

I couldn’t find the corresponding COM Object reference in Visual C#.
I tried to add the wdsmgmt.dll from System32 as a reference in a C# project, but that didn’t work. I’m quite stumped otherwise.

EDIT:

Answer to comment 1:
Best way to access COM objects from C#

The COM Object in question isn’t listed in the references. I’ve looked through the list about 5 times to be sure I wouldn’t miss it.
Would there be a way to make that COM Object show up in the COM references list in C#?

Answer to comment 2 (what did not work):
Trying to add wdsmgmt.dll shows the following error:

Please make sure the file is accessible, and that it is a valid assembly or COM component.

The file is accessible, but it doesn’t seem to be a valid COM component in the eyes of C#.

A search in the registry for WdsMgmt shows that the COM Object is at least somehow present:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CD583E47-B079-4025-A799-5F951D016D3E}

Maybe the rephrased question would be:

How do I add a COM Object reference to C# when I know it’s name in Powershell?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:19:54+00:00Added an answer on June 18, 2026 at 2:19 am

    You can directly mirror what PowerShell does by using dynamic, and creating the instance by ProgId. See https://stackoverflow.com/a/3251325/8446 for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to the Powershell and would need some help with a problem. I
I need convert json object to url form like: parameter=12&asd=1 I done with this:
I need a PowerShell script that can access a file's properties and discover the
I need to convert strings with optional trailing signs into actual numbers using Powershell.
I need to convert a String containing date into an date object. The String
I need to convert a String to enum. I followed the idea in String
I need to convert a string vector in a simple string. I do not
I need to convert full state name to its official state address code. For
I need to convert a time difference (diff) between two actions into a human
I need to convert a Joda-Time DateTime into a String, in the following format:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.