Users

All Posts (41)

avatar

dd5154

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

any updates on this?

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

I changed line 9 to "New-DSSession $Credential $DS_URL -AsApplication"


I get this error:


New-DSSession: /saltstack/base/development/password/DevolutionsRead.ps1:9                        

Line |

  9 |  New-DSSession $Credential $DS_URL -AsApplication

   |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential'.

Get-DSEntrySensitiveData: /saltstack/base/development/password/DevolutionsRead.ps1:10

Line |

 10 |  … tivedata = (Get-DSEntrySensitiveData -EntryId "41981d69-6306-4f8e-9dd …

   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | Session does not seem authenticated, call New-DSSession.

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

Now I get this error


New-DSSession: /saltstack/base/development/password/DevolutionsRead.ps1:9    

Line |

  9 |  New-DSSession $Credential $DS_URL -AsApplication --quiet | out-null

   |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | A positional parameter cannot be found that accepts argument

   | 'System.Management.Automation.PSCredential'.

Get-DSEntrySensitiveData: /saltstack/base/development/password/DevolutionsRead.ps1:10

Line |

 10 |  … tivedata = (Get-DSEntrySensitiveData -EntryId "41981d69-6306-4f8e-9dd …

   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | Session does not seem authenticated, call New-DSSession.

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

DVLS version:  2023.1.8.0

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

DVLS version:  



Get-Module -ListAvailable -Name 'Devolutions.PowerShell'


  Directory: /root/.local/share/powershell/Modules


ModuleType Version  PreRelease Name                PSEdition ExportedCommands

---------- -------  ---------- ----                --------- ----------------

Binary   2023.2.0.4      Devolutions.PowerShell       Core   {Add-RDMRoleRepositoryAccess, Add-RDMRoleToUser, Add-RDMSessionAttachment, Add…

Trying to get script to work with new PowerShell module

avatar
avatar
avatar

Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted

Install-Module -Name Devolutions.PowerShell


$DS_URL= 'https://dps'

$appSecret = ''

$appKey = ''

[securestring]$Password = ConvertTo-SecureString $appSecret -AsPlainText -Force

[pscredential]$Credential = New-Object System.Management.Automation.PSCredential ($appKey, $Password)

New-DSSession $Credential $DS_URL -AsApplication --quiet | out-null

$sensitivedata = (Get-DSEntrySensitiveData -EntryId "41981d69-6306-4f8e-9dd9-0f38cb2db1de").body.data

Write-Output $sensitivedata.credentials.password




Getting this output:


New-DSSession: /saltstack/base/development/password/DevolutionsRead.ps1:10

Line |

 10 |  New-DSSession $Credential $DS_URL -AsApplication --quiet | out-null

   |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential'.

Get-DSEntrySensitiveData: /saltstack/base/development/password/DevolutionsRead.ps1:11

Line |

 11 |  … tivedata = (Get-DSEntrySensitiveData -EntryId "41981d69-6306-4f8e-9dd …

   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | Session does not seem authenticated, call New-DSSession.

PS /saltstack/base/development/password> ./DevolutionsRead.ps1

New-DSSession: /saltstack/base/development/password/DevolutionsRead.ps1:10

Line |

 10 |  New-DSSession $Credential $DS_URL -AsApplication --quiet | out-null

   |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential'.

Get-DSEntrySensitiveData: /saltstack/base/development/password/DevolutionsRead.ps1:11

Line |

 11 |  … tivedata = (Get-DSEntrySensitiveData -EntryId "41981d69-6306-4f8e-9dd …

   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   | Session does not seem authenticated, call New-DSSession.

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

How would I save the password without specifying session?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

I get this when I add it to the existing script


New-RDMRandomPassword: /root/Devolutions.ps1:37                                     

Line |                                                          

 37 |  $p = New-RDMRandomPassword -Mode Pronounceable -Session $s                            

   |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                            

   | Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

ConvertTo-SecureString: /root/Devolutions.ps1:45                                     

Line |                                                          

 45 |  … SessionPassword $s -Password (ConvertTo-SecureString -AsPlainText $p)                     

   |                                    ~~                      

   | Cannot bind argument to parameter 'String' because it is null.  

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Is there a setting to request a random passphrase instead of random characters?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

How do I adjust the length and complexity of the generated password?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

It did update after switching to ID

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

I ran it again and only got this output


PS /root> ./Devolutions.ps1                                               

Unable to save the document; error code:  

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

This time it worked with the following error. How do we specify the complexity and length of the password?


PS /root> ./Devolutions.ps1

WARNING: This is the last major release supporting PowerShell 5.1. Starting with 2023.1, our PowerShell module will be named 'Devolutions.PowerShell and only support PS7.

WARNING: The type initializer for 'Devolutions.Cryptography.Native' threw an exception.\n  at Devolutions.Cryptography.Native.GenerateKeyNative(Byte[] key, UIntPtr keyLength)

  at Devolutions.Cryptography.Managed.GenerateKey(UInt32 keySize)

  at Devolutions.RemoteDesktopManager.Managers.OptionManager.DoLoadOptionEncryption()

  at Devolutions.RemoteDesktopManager.Managers.OptionManager.LoadOptions()

  at Devolutions.RemoteDesktopManager.Managers.ApplicationManager.InitializePhaseOne(String[] args)

  at RemoteDesktopManager.PowerShellModule.BaseCommand.BeginProcessing()

Get-RDMDataSource: /root/Devolutions.ps1:9

Line |

  9 |  $ds = Get-RDMDataSource -Name $dataSourceName

   |                 ~~~~~~~~~~~~~~~

   | Cannot validate argument on parameter 'Name'. The argument "devolutions-server" does not belong to the set "Local Data Source" specified

   | by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.

Unable to save the document; error code:   

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

I can confirm that it didn't work.


Can it be switched to use an entry Id instead of a name?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Thanks for the update

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Any updates?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Website shows 2022.3.6.0 in the lower left hand corner.

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar
$dataSourceName = "devolutions-server"




$ds = Get-RDMDataSource -Name $dataSourceName

if($ds -eq $null)

{

	$ds_url = ''

	$appSecret = ''

	$appKey = ''

	$ds = New-RDMDataSource -DVLS -Name $dataSourceName -Server $ds_url -ScriptingTenantID $appKey -ScriptingApplicationPassword $appSecret -SetDataSource

}




Set-RDMCurrentDataSource $ds




$s = Get-RDMSession -Name ''

$p = New-RDMRandomPassword -Session $s

Set-RDMSessionPassword $s -Password (ConvertTo-SecureString -AsPlainText $p)

Set-RDMSession $s

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Not that I know of


I'm using the script as you sent it

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Now I get this

PS /root> ./Devolutions.ps1  

Unable to save the document; error code:  

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

PS /root> Get-RDMInstance                                                


ApplicationVersion OptionFilename

------------------ --------------

2022.3.1.8     /root/.rdm/RemoteDesktopManager.cfg

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

Set-RDMSessionPassword: /root/Devolutions.ps1:22                                     

Line |                                                          

 22 |  … ord $s -Password (ConvertTo-SecureString -AsPlainText $p) -SetSession                     

   |                                ~~~~~~~~~~~                     

   | A parameter cannot be found that matches parameter name 'SetSession'. 

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

We are getting this error


Get-RDMDataSource: /root/Devolutions.ps1:9

Line |

  9 |  $ds = Get-RDMDataSource -Name $dataSourceName

   |                 ~~~~~~~~~~~~~~~

   | Cannot validate argument on parameter 'Name'. The argument "devolutions-server" does not belong to the set "Local Data Source" specified by the

   | ValidateSet attribute. Supply an argument that is in the set and then try the command again.

Get-RDMSession: /root/Devolutions.ps1:20  

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

$dataSourceName = "devolutions-server"

what should the source name be?


# Get the data source info from RDM config file.

$ds = Get-RDMDataSource -Name $dataSourceName

what rdm config file?


Is there online document that we can't find?

Using powershell to update an existing password entry

avatar
avatar
avatar
avatar
avatar

We want to generate and set a new password for an existing entry in a vault. Then we want to retrieve that password from the entry. Can you show us how to do it using the remote desktop cmdlet?

1 - 25 of 41 items