OneIdentity / safeguard-ps

One Identity Safeguard PowerShell scripting resources
Apache License 2.0
22 stars 27 forks source link

Version 7.4.126553 Connect-Safeguard with -Gui throws Error #501

Open Josefper opened 1 year ago

Josefper commented 1 year ago

Function Wait-SafeguardApplianceStateOnline 7.4.126553 safeguard-ps

PS C:\Users\administrator.ONEIDENTITY> Connect-Safeguard 192.168.111.10 -Gui Add-Type : (0) : Metadata file 'System.Security.Cryptography.dll' could not be found (1) : using System; At C:\Program Files\WindowsPowerShell\Modules\safeguard-ps\7.4.126553\safeguard-ps.psm1:82 char:9

dukkse77 commented 1 year ago

I have the same error.

JeffHarkavy commented 1 year ago

@dukkse77 @Josefper Thank you for contacting us. What version of Powershell are you using ($PSVersionTable output)?

dukkse77 commented 1 year ago

Hey!! I have this

Name Value


PSVersion 5.1.19041.1682 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.1682 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

And my collegue just told me that if you upgrade to 7, it works. Even though it worked a couple of weeks ago with above version.

JeffHarkavy commented 1 year ago

@dukkse77 ok, it does work in PS 7.3.9 but yes, I'm seeing the same thing in PS 5.1. safeguard-ps v7.4 was released "a couple weeks ago" (3 as of this writing), so perhaps some .NET dependency issue has crept in. We'll look into it.

thx

viperat commented 1 year ago

Hi Jeff,

just for information: i tried it now on 2 machines (Win 10 22H2 Build 19045.3570 and Windows Server 2022 21H2 Build 20348.17266) both up-to-date same issue...

Win10: Name Value


PSVersion 5.1.19041.3570 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.3570 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Win 2022 SRV: Name Value


PSVersion 5.1.20348.1366 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.20348.1366 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

I also Installed the newest Version of PS 7.3.9 but then i get: PowerShell 7.3.9 PS C:\Users\jp> Connect-safeguard 192.168.111.20 -Insecure -Gui Exception: This -Gui parameter is not supported in PowerShell Core

JeffHarkavy commented 1 year ago

@viperat Thanks for the extra info. That exception is from safeguard-ps v7.3. In v7.4 we've deprecated the -Gui parameter in favor of -Browser.

For reference here's what my environment shows

PS  C:\Users\jharkavy > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.9
PSEdition                      Core
GitCommitId                    7.3.9
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS  C:\Users\jharkavy > get-command "connect-safeguard"

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Connect-Safeguard                                  7.4.126553 safeguard-ps

PS  C:\Users\jharkavy > Connect-safeguard 10.9.4.234 -gui -insecure
Login Successful.
nawazsarwar124 commented 11 months ago

How did you resolve the problem, i have the same problem. Please suggest us the solution?