Citrix Virtual Apps and Desktops SDK

Set-AcctServiceAccount

Introduced in: Citrix Virtual Apps and Desktop 7 2308

Update parameters of a service account.

Syntax

Set-AcctServiceAccount
   -ServiceAccountUid <Guid>
   [-AccountId <String>]
   [-AccountSecret <SecureString>]
   [-SecretExpiryTime <String>]
   [-Capabilities <String[]>]
   [-DisplayName <String>]
   [-Description <String>]
   [-IsHealthy <String>]
   [-CustomProperties <String>]
   [-UserPrincipalName <String>]
   [-UserSecret <SecureString>]
   [-UserSecretExpiryTime <String>]
   [-RenewBulkEnrollmentToken]
   [-LoggingId <Guid>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->

Description

Provides the ability to modify the parameters of a service account.

Examples

EXAMPLE 1

Changes the AccountId for service account specified by uid 17631afc-2e4c-491e-b0aa-f979a80e32c1.

Set-AcctServiceAccount -ServiceAccountUid 17631afc-2e4c-491e-b0aa-f979a80e32c1 -AccountId deb0811e-4839-4cce-87d3-8f36b31c2934

                    ServiceAccountUid            : 17631afc-2e4c-491e-b0aa-f979a80e32c1
                    IdentityProviderIdentifier   : f439f4c0-fcd8-4fe6-95b8-71e7e49dc8c6
                    IdentityProviderType         : AzureAD
                    SecretExpiryTime             : 9/8/2024 8:00:00 PM
                    AccountId                    : deb0811e-4839-4cce-87d3-8f36b31c2934
                    Capabilities                 : {AzureArcResourceManagement}
                    CustomProperties             :
                    FailureReason                :
                    IsHealthy                    : True
                    Revision                     : 34bf0bea-d9dd-4d42-80b2-610ee28230c1
                    Scopes                       : {}
                    TenantId                     :
<!--NeedCopy-->

EXAMPLE 2

Changes the AccountSecret for service account specified by uid ad24284e-ba3d-4504-80db-9ac6640de533.

Set-AcctServiceAccount -ServiceAccountUid ad24284e-ba3d-4504-80db-9ac6640de533 -AccountSecret $newPassword

ServiceAccountUid            : ad24284e-ba3d-4504-80db-9ac6640de533
IdentityProviderIdentifier   : test.local
IdentityProviderType         : ActiveDirectory
SecretExpiryTime             : 9/8/2024 8:00:00 PM
AccountId                    : test\svcacct_1
Capabilities                 :
CustomProperties             :
FailureReason                :
IsHealthy                    : True
Revision                     : 34bf0bea-d9dd-4d42-80b2-610ee28230c1
Scopes                       : {}
TenantId                     :
<!--NeedCopy-->

EXAMPLE 3

Changes the DisplayName or Description for service account specified by uid ad24284e-ba3d-4504-80db-9ac6640de533.

Set-AcctServiceAccount -ServiceAccountUid ad24284e-ba3d-4504-80db-9ac6640de533 -DisplayName "ctxlabxx" -Description "xxapp"

ServiceAccountUid            : ad24284e-ba3d-4504-80db-9ac6640de533
IdentityProviderIdentifier   : test.local
IdentityProviderType         : ActiveDirectory
SecretExpiryTime             : 9/8/2024 8:00:00 PM
AccountId                    : test\svcacct_1
Capabilities                 :
CustomProperties             :
Description                  : xxapp
DisplayName                  : ctxlabxx
FailureReason                :
IsHealthy                    : True
Revision                     : 34bf0bea-d9dd-4d42-80b2-610ee28230c1
Scopes                       : {}
TenantId                     :
<!--NeedCopy-->

EXAMPLE 4

Changes the health status for service account specified by uid ad24284e-ba3d-4504-80db-9ac6640de533.

Set-AcctServiceAccount -ServiceAccountUid ad24284e-ba3d-4504-80db-9ac6640de533 -IsHealthy True

ServiceAccountUid            : ad24284e-ba3d-4504-80db-9ac6640de533
IdentityProviderIdentifier   : test.local
IdentityProviderType         : ActiveDirectory
SecretExpiryTime             : 9/8/2024 8:00:00 PM
AccountId                    : test\svcacct_1
Capabilities                 :
CustomProperties             :
Description                  : xxapp
DisplayName                  : ctxlabxx
FailureReason                :
IsHealthy                    : True
Revision                     : 34bf0bea-d9dd-4d42-80b2-610ee28230c1
Scopes                       : {}
TenantId                     :
<!--NeedCopy-->

EXAMPLE 5

Changes the custom properties for service account specified by uid ad24284e-ba3d-4504-80db-9ac6640de533.

Set-AcctServiceAccount -ServiceAccountUid ad24284e-ba3d-4504-80db-9ac6640de533 -CustomProperties '{"ProxyHypervisorTrafficThroughConnector":true,"UseSystemProxyForHypervisorTrafficOnConnectors":false,"ProxyTrafficThroughHighlyAvailableServer":false,"ZoneUid":["ac65fbab-71d3-4a18-a991-97c2683d4401"]}'

ServiceAccountUid            : ad24284e-ba3d-4504-80db-9ac6640de533
IdentityProviderIdentifier   : test.local
IdentityProviderType         : ActiveDirectory
SecretExpiryTime             : 9/8/2024 8:00:00 PM
AccountId                    : test\svcacct_1
Capabilities                 :
CustomProperties             : {"ProxyHypervisorTrafficThroughConnector":true,"UseSystemProxyForHypervisorTrafficOnConnectors":false,"ProxyTrafficThroughHighlyAvailableServer":false,"ZoneUid":["ac65fbab-71d3-4a18-a991-97c2683d4401"]}
Description                  : xxapp
DisplayName                  : ctxlabxx
FailureReason                :
IsHealthy                    : True
Revision                     : 34bf0bea-d9dd-4d42-80b2-610ee28230c1
Scopes                       : {}
TenantId                     :
<!--NeedCopy-->

Parameters

-ServiceAccountUid

The unique identifier for the service account that is to be modified.

Type: Guid
Position: Named
Default value: None
Required: True
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-AccountId

The identifier for the service account.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-AccountSecret

The secret for the service account. E.g. Azure application (client) secret if ‘IdentityProviderType’ is AzureAD. The secret will be encrypted and stored in database.

Type: SecureString
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SecretExpiryTime

The secret expiration time for the service account. If specify as empty string (“”), will set secret as never expires.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Capabilities

The capabilities for the service account.

Type: String[]
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-DisplayName

The display name for the service account.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Length range: 0 to 128
Disallowed characters: \/;:#.*?=<>\|[]()"'
Introduced in: Citrix Virtual Apps and Desktop 7 2407

-Description

The description for the service account.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2407

-IsHealthy

The health status of the service account.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-CustomProperties

The custom properties of the service account.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-UserPrincipalName

The Azure AD User UserPrincipalName if ‘IdentityProviderType’ is AzureAD.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2511

-UserSecret

The secret for the service account azure AD user. if ‘IdentityProviderType’ is AzureAD. The secret will be encrypted and stored in database.

Type: SecureString
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2511

-UserSecretExpiryTime

The Azure AD user secret expiration time for the service account. If it is not specified, will set secret as never expires.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2511

-RenewBulkEnrollmentToken

Indicates whether to renew the bulk enrollment token for the service account.

Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2511

-LoggingId

Specifies the identifier of the high-level operation this cmdlet call forms a part of. Citrix Studio and Director typically create high-level operations. PowerShell scripts can also wrap a series of cmdlet calls in a high-level operation by way of the Start-LogHighLevelOperation and Stop-LogHighLevelOperation cmdlets.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -SkipCertificateValidation, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You can’t pipe objects to this cmdlet.

Outputs

Citrix.ADIdentity.Sdk.ServiceAccount

This object provides details of the service account and contains the following information:

ServiceAccountUid <GUID> The unique identifier of the service account. SecretExpiryTime <Datetime> The expiration time for the secret of the service account. AccountId <string> The identifier for the service account. E.g. Azure application ID if the service account is with Azure AD as identity provider. IdentityProviderIdentifier <string> The identifier of the identity provider that the service account belongs to. E.g. Azure AD tenant ID. IdentityProviderType <string> The type of the identity provider of the service account. Can be AzureAD or ActiveDirectory. IsHealthy <bool> Indicates if the service account is healthy. Capabilities <string[]> Capabilities of the service account. Can be AzureArcResourceManagement AzureADDeviceManagement AzureADSecurityGroupManagement IntuneDeviceManagement. FailureReason <string> The reason why the service account becomes unhealthy. Scopes <Citrix.ADIdentity.Sdk.ScopeReference[]> The administration scopes associated with this identity pool. TenantId <GUID> Identity of the Citrix tenant associated with this identity pool. Not applicable (always blank) in non-multitenant sites. DisplayName <string> The display name of the service account. Description <string> The description of the service account. IsHealthy <string> The health status of the service account. CustomProperties <string> The custom properties of the service account. AzureADUser <Citrix.ADIdentity.Sdk.ServiceAccountAzureADUser> The Azure AD user associated with the service account.

Notes

If the command fails, the following errors can be returned:

  • ServiceAccountObjectNotFound

    The specified service account could not be located.

  • InvalidServiceAccountCapabilities

    One or more specified service account capabilities are not supported.

  • DatabaseError

    An error occurred in the service while attempting a database operation.

  • DatabaseNotConfigured

    The operation could not be completed because the database for the service is not configured.

  • DataStoreException

    An error occurred in the service while attempting a database operation - communication with the database failed for various reasons.

  • PermissionDenied

    You do not have permission to execute this command.

  • AuthorizationError

    There was a problem communicating with the Citrix Delegated

  • Administration Service.
  • CommunicationError

    There was a problem communicating with the remote service.

  • ExceptionThrown

    An unexpected error occurred. For more details, see the Windows event logs on the controller or the Citrix Virtual Apps and Desktops logs.

Set-AcctServiceAccount