File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ $<VariableName> = <Get-Mailbox | Get-User> -ResultSize Unlimited -Filter <Filter
65
65
```
66
66
67
67
``` powershell
68
- $<VariableName> | ForEach-Object {Set-User $_ -RemotePowerShellEnabled $false}
68
+ $<VariableName> | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
69
69
```
70
70
71
71
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')
75
75
```
76
76
77
77
``` powershell
78
- $DSA | ForEach-Object {Set-User $_ -RemotePowerShellEnabled $false}
78
+ $DSA | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
79
79
```
80
80
81
81
### Use a list of specific users
@@ -101,7 +101,7 @@ $NPS = Get-Content "C:\My Documents\NoPowerShell.txt"
101
101
```
102
102
103
103
``` powershell
104
- $NPS | ForEach-Object {Set-User $_ -RemotePowerShellEnabled $false}
104
+ $NPS | foreach {Set-User -Identity $_ -RemotePowerShellEnabled $false}
105
105
```
106
106
107
107
## View the remote PowerShell access for users
You can’t perform that action at this time.
0 commit comments