How to extract data of local from powershell using uipath studio

Hi @Palaniyappan @Anil_G
How to extract data of local from powershell using UiPath studio?
I have UiPath studio enterprise version 2021.10.3

Please also mention argument type with command which I can use in invoke power shell.

I would appreciate a prompt response here!

Thanks
Mohini

Hi @Mohini_Sarode

Please go through this

Cheers!!

HI @Mohini_Sarode

Check the below youtube video to get the clarification about invoke powershell and typeargument selection,

Hope it helps!!

This is something else !

Hi @Mohini_Sarode ,

Could you please let us what data from local, I mean what is the input type? Is its a pdf, text, excel or something else?

I want to get local user data.

While running manually command in powershell “get-localuser” I am getting list of user the same list i want extract using UiPath

Thanks in advance

Regards
Mohini

@Mohini_Sarode

Please check this…this is exactly similar to what you need…invoke powershell has an output variable that can be used

In this table is extracted

Similarly for your case five the command you need and whatever would be the output in console you will get same in variable with appropriate type…you can print and check

Cheers

Hi @Anil_G

I have used the same command and argument type however I didn’t get the required output.
I want to extract local user list from a VM by using powershell activity.

@Mohini_Sarode

What output were you getting…can you show please…and how you have implemented

Cheers

I have used same get process example of tutorial it’s giving fine output but I wants to run get local user command for this same argument type i have used but its giving me error for argument type which is system.diagnostic.process …its for get process what should be for get local user ???

@Mohini_Sarode

Try this

Array of System.Management.Automation.SecurityAccountsManager.LocalUser

Cheers

Hi @Anil_G

I have tried this but I am not getting array of while browsing, please guide where I can get array of System.managment.automation.securityaccountmanager.localuser

Thanks in advance

Please check image for your reference

@Mohini_Sarode

try with System.Management.Automation.PSCustomObject

also can you tell for what you need this?

cheers

Did you ever try the Search?
image

Cheers

I am getting error plz find attached photo i want to extract username of remote desktop(VM) manually which we get running command line get-localuser using powershell i want those to extract using UiPath

Thanks for your valuable time but plz help

@Mohini_Sarode

If that is the need then you can use

Environment.UserName

cheers

You can format the output as text first before outputting it to UiPath:

Get-LocalUser | Select-Object -ExpandProperty Name

Then you can just set the TypeArgument to String and Output type to Collection of String.
image

image

image

I am having 2021.10.3 UiPath enterprise version which doesn’t have Execution mode option

Thanks for this solution but it is not working for me

If you don’t have Execution Mode, test to change the CommandText to:

powershell.exe {Get-LocalUser | Select-Object -ExpandProperty Name}

It will force the Invoke PowerShell to use Windows PowerShell instead of its own copy.