Set‑SqlDscRSServiceAccount - dsccommunity/SqlServerDsc GitHub Wiki
Sets the service account for SQL Server Reporting Services.
Set-SqlDscRSServiceAccount [-Configuration] <Object> [-Credential] <PSCredential> [-UseBuiltInAccount]
[-RestartService] [-PassThru] [-Force] [-SuppressUrlReservationWarning]
[-WhatIf] [-Confirm] [<CommonParameters>]
Sets the Windows service account for SQL Server Reporting Services or
Power BI Report Server by calling the SetWindowsServiceIdentity
method on the MSReportServer_ConfigurationSetting CIM instance.
This command changes the Windows service account that the Reporting Services service runs under. Sets file permissions on files and folders in the report server installation directory. The account requires LogonAsService rights in Windows, the specified account will be granted this right.
The configuration CIM instance can be obtained using the
Get-SqlDscRSConfiguration command and passed via the pipeline.
$credential = Get-Credential
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Set-SqlDscRSServiceAccount -Credential $credential -RestartService
Sets the service account for Reporting Services and restarts the service.
$credential = New-Object System.Management.Automation.PSCredential('NT AUTHORITY\NetworkService', (New-Object System.Security.SecureString))
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Set-SqlDscRSServiceAccount -Credential $credential -UseBuiltInAccount -Force
Sets the service account to NetworkService without confirmation.
$credential = Get-Credential
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Set-SqlDscRSServiceAccount -Credential $credential -PassThru
Sets the service account and returns the configuration CIM instance.
Specifies the MSReportServer_ConfigurationSetting CIM instance for
the Reporting Services instance.
This can be obtained using the
Get-SqlDscRSConfiguration command.
This parameter accepts pipeline
input.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies the credentials for the new service account. The username should be in the format 'DOMAIN\Username' for domain accounts or 'Username' for local accounts.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, suppresses the confirmation prompt.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, returns the configuration CIM instance after setting the service account.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, restarts the Reporting Services service after changing the service account. The service must be restarted for the change to take effect.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, suppresses the warning message about URL reservations needing to be updated when the service account changes.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIndicates that the account specified is a built-in Windows account such as 'NT AUTHORITY\NetworkService' or 'NT AUTHORITY\LocalSystem'. When this switch is used, only the username portion of the Credential is used and the password is ignored.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The Reporting Services service must be restarted for the change to take effect. Use the -RestartService parameter or manually restart the service.
URL reservations are created for the current service account. Changing the service account requires updating all URL reservations.