I was trying to get machine name

hello Team,

I was trying to get machine name using “Environment.MachineName” but its showing error as (“MachineName” is not a string member.)

Hi Aditi,

Follow the next steps as below:

  1. Create a variable of type string.
  2. Drag and drop an Assign activity and assign the value. In this case Environment.MachineName.

Hope helps you!

1 Like

Hi @aditi.bhatt

You can try any of below syntax

Assign -> machineName= System.Net.Dns.GetHostName()

Or

Assign -> machineName= Environment.MachineName

machineName variable is of DataType System.String.

Regards

Hi,

I guess you define string variable named environment and it causes this error.

So can you try either of the following?

  • Use System.Environment.MachineName (Add System.)

  • Rename the variable, then use Environment.MachineName

Regards,