HewlettPackard / PowerShell-ProLiant-SDK

PowerShell sample scripts for managing HPE servers
https://www.hpe.com/servers/powershell
90 stars 42 forks source link

Adding and Removing Directory Groups not working #53

Closed deloid closed 1 year ago

deloid commented 4 years ago

I cannot add a new Directory Group or remove an existing one - The same exception is always thrown at the same place with both (see below). I get this with PS v5.1 also.

Using hpeilocmdlets 3.0.0.1 against ILO5 2.31 $connection has DisableCertificateAuthentication set to True

PS> Remove-HPEiLODirectoryGroup -Connection $connection -GroupName "Administrators" -verbose
VERBOSE: Performing the operation "Remove-HPEiLODirectoryGroup" on target "x.x.x.x".
VERBOSE: Executing the cmdlets with 1 task serially.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: GetRedfishExistingDirGroup - Getting directory settings data by Redfish interface.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Validating Cmdlet supportability.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Checking for iLOGeneration, Model and Firmware for Cmdlet Supportability.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Validating parameter supportability.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Getting JSON url for ODataType AccountService.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Getting OdataId for OdataType AccountService.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Getting url value from resource instance.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: JSON url is /redfish/v1/AccountService/
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: JSON URL with query is- /redfish/v1/AccountService/?$select=Oem.Hpe.DirectorySettings.LdapServerPort,Oem.Hpe.DirectorySettings.LdapAuthenticationMode,LDAP.ServiceAddresses,LDAP.AccountProviderType,LDAP.LDAPService.SearchSettings.BaseDistinguishedNames,LocalAccountAuth,LDAP.Authentication.Username,LDAP.RemoteRoleMapping
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Sending Redfish request.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Processing JSON response.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Response Type is HPE.iLO.Response.Redfish.DirectorySettingInfo
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: Processing complex JSON response.
VERBOSE: [Remove-HPEiLODirectoryGroup][x.x.x.x]: GetRemoteRoleMapping - Getting existing iLO directory users
Remove-HPEiLODirectoryGroup: [x.x.x.x]: Target url(s) could not be located.
hp-powershell commented 4 years ago

Hi ,

Thanks for writing to us .

iLO FW 2.30 has introduced a major change in Redfish URI format. In order to support this change which iLO has introduced HPEiLOCmdlets need to undergo changes.

As currently the powershell cmdlets are trailing releases, version 3.0.0.1 is not with FW 2.30 support as its released prior to the release of the FW .2.30

Powershell team is already in the middle of next release to support iLO FW 2.30 . Team is working on stretch basis to roll out the new version ASAP.

Thanks & Regards, HPE Powershell Team

MichaelKuch commented 4 years ago

Hi,

I am facing the same issues with adding and removing directory groups on iLO5 with firmware >=2.30.

We are using Powershell scripts to configure existing and new iLO5 in our production environment with about 1000 iLOs. This is broken for more than 2 months and it is more than unsatisfactory that a firmware update introduces an unsupported change and that there is no timely support with the HPEiLO cmdlets.

Does your powershell team has an expected release time for the new release working with firmware 2.30 and above on iLO5?

Best regards Michael Kuch

hp-powershell commented 4 years ago

Hi,

We understand the inconvenience caused at your end. This change in iLO FW 2.30 has effected multiple cmdlets and the impact is huge at Powershell cmdlets. Team has already started working on this release on a stretch basis. We have targeted the build for Jan 2021.

Thanks & Regards, Powershell Team

hp-powershell commented 3 years ago

Hi ,

The new version HPEiLOCmdlets 3.1 is live now and available to download from Powershell Gallery and also the HPE support portal .

Kindly upgrade and let us know if any findings .

Thanks & Regards, Powershell Team

deloid commented 3 years ago

Updated to module version 3.1.0.0 and trying to run the same scripts against an ILO5 v2.35 and still receiving the same error when I try Add-HPEiLODirectoryGroup. Remove-HPEiLODirectoryGroup works though.

Simplified command to show error:

C:\WINDOWS\system32> Add-HPEiLODirectoryGroup -Connection $connection -GroupName $directoryGroup -GroupSID $groupSID -UserConfigPrivilege Yes -verbose
VERBOSE: Performing the operation "Add-HPEiLODirectoryGroup" on target "******".
VERBOSE: Executing the cmdlets with 1 task serially.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Checking privileges and adding to array of string
VERBOSE: [Add-HPEiLODirectoryGroup][******]: GetRedfishExistingDirGroup - Getting directory settings data by Redfish interface.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Validating Cmdlet supportability.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Checking for iLOGeneration, Model and Firmware for Cmdlet Supportability.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Validating parameter supportability.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Getting JSON url for ODataType AccountService.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Getting OdataId for OdataType AccountService.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Getting url value from resource instance.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: JSON url is /redfish/v1/AccountService/
VERBOSE: [Add-HPEiLODirectoryGroup][******]: JSON URL with query is- /redfish/v1/AccountService/
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Sending Redfish request.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Processing JSON response.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Response Type is HPE.iLO.Response.Redfish.DirectorySettingInfo
VERBOSE: [Add-HPEiLODirectoryGroup][******]: Processing complex JSON response.
VERBOSE: [Add-HPEiLODirectoryGroup][******]: GetRemoteRoleMapping - Getting existing iLO directory users
Add-HPEiLODirectoryGroup : [******]: Target url(s) could not be located.
At line:1 char:1
+ Add-HPEiLODirectoryGroup -Connection $connection -GroupName $director ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Add-HPEiLODirectoryGroup], Exception
    + FullyQualifiedErrorId : HPE.iLO.Cmdlet.AddHPEiLODirectoryGroup

Further info from the exception:

TargetSite     : System.Tuple`2[System.Boolean,System.Object] ValidateCmdletRecord(HPE.Framework.Core.CmdletRecord)
StackTrace     :    at HPE.iLO.Cmdlet.AddHPEiLODirectoryGroup.ValidateCmdletRecord(CmdletRecord cmdletRecord)
                    at HPE.Framework.Core.CmdletBase.ProcessCommand(CmdletRecord cmdletRecord)
HelpLink       :
Source         : HPEiLOCmdlets
HResult        : -2146233088
hp-powershell commented 3 years ago

Hi ,

Thanks for writing to us .

Sorry for the inconvenience at your end due to this.

on closer look at it we are seeing that post the issue with ilo 5 fw 2.30 uri resolved this issue you have mentioned here is pointing at a different root cause for which we have a dependency on iLOTeam as to see whether there is a redfish enablement lack to tackle the updating of directory policies . We are in discussion with iLO redfish team for same.

Also we see that when there are no groups available already , as in your case above you are getting URL not found , this we are trying to fix currently and checking with ILO Team on redfish interface corrections involved here .

I have already taken this case you have raised here to my upper management and have discussed on customers being highly impacted by the same and talked about urgency in providing the right solution immediately. If we identify that the iLO team has a redfish interface to aid the directory group addition in case of zero groups , we are planning to give you a point release by enabling same in our cmdlets too.

We are having a tracking defect in our system with high priority for the same and we are working at it already.

thanks for understanding.

Thanks & Regards, Powershell Team

With no groups present at the time of creation

hp-powershell commented 1 year ago

Hi ,

Kindly check the behavior on our new version hpeilocmdlets 3.2. Let us know if issue is resolved .

Thanks & Regards, Powershell Team

deloid commented 1 year ago

I just tested this on PS 7.2.5 and hpeilocmdletss 3.2 successfully.