Skip to content

Commit 1d43515

Browse files
committed
Update control-remote-powershell-access-to-exchange-servers.md
Issue #9990
1 parent 2f8328d commit 1d43515

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

exchange/docs-conceptual/control-remote-powershell-access-to-exchange-servers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $<VariableName> = <Get-Mailbox | Get-User> -ResultSize unlimited -Filter <Filter
6565
```
6666

6767
```powershell
68-
$<VariableName> | foreach {Set-User -RemotePowerShellEnabled $false}
68+
$<VariableName> | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
6969
```
7070

7171
This example removes access to remote PowerShell for all users whose **Title** attribute contains the value "Sales Associate".
@@ -75,7 +75,7 @@ $DSA = Get-User -ResultSize unlimited -Filter "(RecipientType -eq 'UserMailbox')
7575
```
7676

7777
```powershell
78-
$DSA | foreach {Set-User -RemotePowerShellEnabled $false}
78+
$DSA | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
7979
```
8080

8181
### Use a list of specific users
@@ -87,7 +87,7 @@ $<VariableName> = Get-Content <text file>
8787
```
8888

8989
```powershell
90-
$<VariableName> | foreach {Set-User -RemotePowerShellEnabled $false
90+
$<VariableName> | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false
9191
```
9292

9393
This example uses the text file C:\My Documents\NoPowerShell.txt to identify the users by their user principal name (UPN). The text file must contain one UPN on each line like this:
@@ -101,7 +101,7 @@ $NPS = Get-Content "C:\My Documents\NoPowerShell.txt"
101101
```
102102

103103
```powershell
104-
$NPS | foreach {Set-User -RemotePowerShellEnabled $false}
104+
$NPS | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
105105
```
106106

107107
## View the remote PowerShell access for users

0 commit comments

Comments
 (0)