Disable-PSRemoting

Zapobiega odbieraniu połączeń zdalnych przez punkty końcowe programu PowerShell.

Składnia

Disable-PSRemoting
       [-Force]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Opis

To polecenie cmdlet jest dostępne tylko na platformie Windows.

Polecenie Disable-PSRemoting cmdlet blokuje zdalny dostęp do wszystkich konfiguracji punktów końcowych sesji programu PowerShell w wersji 6 i nowszej na komputerze lokalnym. Nie ma to wpływu na konfiguracje punktów końcowych programu Windows PowerShell. Aby wyłączyć konfiguracje punktów końcowych sesji programu Windows PowerShell, uruchom Disable-PSRemoting polecenie z poziomu sesji programu Windows PowerShell.

Aby ponownie włączyć zdalny dostęp do wszystkich konfiguracji punktów końcowych sesji programu PowerShell w wersji 6 i nowszej, użyj Enable-PSRemoting polecenia cmdlet . Aby ponownie włączyć zdalny dostęp do wszystkich konfiguracji punktów końcowych sesji programu Windows PowerShell, uruchom polecenie Enable-PSRemoting z poziomu sesji programu Windows PowerShell.

Uwaga

Jeśli chcesz wyłączyć dostęp zdalny programu PowerShell do lokalnego komputera z systemem Windows, należy uruchomić to polecenie zarówno z poziomu sesji programu PowerShell w wersji 6, jak i z poziomu sesji programu Windows PowerShell. Program Windows PowerShell jest instalowany domyślnie na wszystkich maszynach z systemem Windows.

Aby wyłączyć i ponownie włączyć dostęp zdalny do określonych konfiguracji punktu końcowego sesji, użyj Enable-PSSessionConfiguration poleceń cmdlet i Disable-PSSessionConfiguration . Aby ustawić określone konfiguracje dostępu poszczególnych punktów końcowych, użyj Set-PSSessionConfiguration polecenia cmdlet wraz z parametrem AccessMode . Aby uzyskać więcej informacji na temat konfiguracji sesji, zobacz Informacje o konfiguracjach sesji.

Uwaga

Nawet po uruchomieniu Disable-PSRemoting można nadal tworzyć połączenia sprzężenia zwrotnego na komputerze lokalnym. Połączenie sprzężenia zwrotnego to sesja zdalna programu PowerShell, która pochodzi z tej samej maszyny lokalnej i nawiązuje połączenie z tą samą maszyną lokalną. Sesje zdalne ze źródeł zewnętrznych pozostają zablokowane. W przypadku połączeń sprzężenia zwrotnego należy użyć niejawnych poświadczeń wraz z parametrem EnableNetworkAccess . Aby uzyskać więcej informacji na temat połączeń sprzężenia zwrotnego, zobacz New-PSSession.

To polecenie cmdlet jest dostępne tylko na platformie Windows. Nie jest ona dostępna w wersjach programu PowerShell dla systemu Linux lub macOS. Aby uruchomić to polecenie cmdlet, uruchom program PowerShell przy użyciu opcji Uruchom jako administrator .

Przykłady

Przykład 1: Zapobieganie dostępowi zdalnemu do wszystkich konfiguracji sesji programu PowerShell

Ten przykład uniemożliwia zdalny dostęp do wszystkich konfiguracji punktów końcowych sesji programu PowerShell na komputerze.

Disable-PSRemoting

WARNING: PowerShell remoting has been disabled only for PowerShell 6+ configurations and does not affect
 Windows PowerShell remoting configurations. Run this cmdlet in Windows PowerShell to affect all PowerShell
 remoting configurations.

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

Przykład 2: Uniemożliwianie dostępu zdalnego do wszystkich konfiguracji sesji programu PowerShell bez monitu o potwierdzenie

Ten przykład uniemożliwia dostęp zdalny do wszystkich konfiguracji punktów końcowych sesji programu PowerShell na komputerze bez monitowania.

Disable-PSRemoting -Force

WARNING: PowerShell remoting has been disabled only for PowerShell 6+ configurations and does not affect
 Windows PowerShell remoting configurations. Run this cmdlet in Windows PowerShell to affect all PowerShell
 remoting configurations.

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

Przykład 3. Efekty uruchamiania tego polecenia cmdlet

W tym przykładzie pokazano efekt użycia Disable-PSRemoting polecenia cmdlet . Aby uruchomić tę sekwencję poleceń, uruchom program PowerShell przy użyciu opcji Uruchom jako administrator .

Po wyłączeniu konfiguracji New-PSSession sesji polecenie cmdlet próbuje utworzyć sesję zdalną na komputerze lokalnym (znanym również jako "sprzężenie zwrotne"). Ponieważ dostęp zdalny jest wyłączony na komputerze lokalnym, polecenie kończy się niepowodzeniem.

Disable-PSRemoting -Force
New-PSSession -ComputerName localhost -ConfigurationName PowerShell.6

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

New-PSSession : [localhost] Connecting to remote server localhost failed with the following error
 message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ComputerName localhost -ConfigurationName PowerShell.6
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Management.A\u2026tion.RemoteRunspace:RemoteRunspace)
 [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

Przykład 4. Efekty uruchamiania tego polecenia cmdlet i Enable-PSRemoting

W tym przykładzie pokazano wpływ na konfiguracje sesji przy użyciu Disable-PSRemoting poleceń cmdlet i Enable-PSRemoting .

Disable-PSRemoting Służy do wyłączania dostępu zdalnego do wszystkich konfiguracji punktów końcowych sesji programu PowerShell. Parametr Force pomija wszystkie monity użytkownika. Polecenia Get-PSSessionConfiguration cmdlet i Format-Table wyświetlają konfiguracje sesji na komputerze.

Dane wyjściowe pokazują, że wszyscy użytkownicy zdalni z tokenem sieciowym nie mają dostępu do konfiguracji punktu końcowego. Administracja istratory grupy na komputerze lokalnym mogą uzyskiwać dostęp do konfiguracji punktu końcowego, o ile łączą się lokalnie (nazywane również sprzężenia zwrotnego) i używają niejawnych poświadczeń.

Disable-PSRemoting -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -AutoSize

Enable-PSRemoting -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -AutoSize

Name               Permission
----               ----------
PowerShell.6       NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed ...
PowerShell.6.2.0   NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed ...

Name               Permission
----               ----------
PowerShell.6       NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed ...
PowerShell.6.2.0   NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed ...

Polecenie Enable-PSRemoting cmdlet ponownie włącza zdalny dostęp do wszystkich konfiguracji punktów końcowych sesji programu PowerShell na komputerze. Parametr Force pomija wszystkie monity użytkownika i uruchamia ponownie usługę WinRM bez monitowania. Nowe dane wyjściowe pokazują, że deskryptory zabezpieczeń AccessDenied zostały usunięte ze wszystkich konfiguracji sesji.

Przykład 5. Połączenia sprzężenia zwrotnego z wyłączonymi konfiguracjami punktów końcowych sesji

W tym przykładzie pokazano, jak są wyłączone konfiguracje punktów końcowych i pokazano, jak nawiązać pomyślne połączenie sprzężenia zwrotnego z wyłączonym punktem końcowym. Disable-PSRemoting wyłącza wszystkie konfiguracje punktów końcowych sesji programu PowerShell.

Disable-PSRemoting -Force

WARNING: PowerShell remoting has been disabled only for PowerShell 6+ configurations and does not affect
 Windows PowerShell remoting configurations. Run this cmdlet in Windows PowerShell to affect all PowerShell
 remoting configurations.

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

New-PSSession -ComputerName localhost -ConfigurationName powershell.6 -Credential (Get-Credential)

PowerShell credential request
Enter your credentials.
User: UserName
Password for user UserName: ************

New-PSSession: [localhost] Connecting to remote server localhost failed with the following error message
 : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.

New-PSSession -ComputerName localhost -ConfigurationName powershell.6 -EnableNetworkAccess

Id Name       Transport ComputerName  ComputerType   State   ConfigurationName   Availability
 -- ----       --------- ------------  ------------   -----   -----------------   ------------
 1  Runspace1  WSMan     localhost     RemoteMachine  Opened  powershell.6           Available

Pierwsze użycie New-PSSession prób utworzenia sesji zdalnej na komputerze lokalnym. Parametr ConfigurationName służy do określania wyłączonego punktu końcowego programu PowerShell. Poświadczenia są jawnie przekazywane do polecenia za pośrednictwem parametru Credential . Ten typ połączenia przechodzi przez stos sieciowy i nie jest sprzężenia zwrotnego. W związku z tym próba nawiązania połączenia z wyłączonym punktem końcowym kończy się niepowodzeniem z powodu błędu odmowy dostępu.

Drugie użycie New-PSSession programu próbuje również utworzyć sesję zdalną na maszynie lokalnej. W takim przypadku zakończy się powodzeniem, ponieważ jest to połączenie sprzężenia zwrotnego, które pomija stos sieciowy.

Połączenie sprzężenia zwrotnego jest tworzone po spełnieniu następujących warunków:

  • Nazwa komputera do nawiązania połączenia to "localhost".
  • Nie są przekazywane żadne poświadczenia. Bieżący zalogowany użytkownik (niejawne poświadczenia) jest używany na potrzeby połączenia.
  • Jest używany parametr przełącznika EnableNetworkAccess .

Aby uzyskać więcej informacji na temat połączeń sprzężenia zwrotnego, zobacz dokument New-PSSession .

Przykład 6. Wyłączanie wszystkich konfiguracji punktów końcowych komunikacji zdalnej programu PowerShell

W tym przykładzie pokazano, jak uruchomienie Disable-PSRemoting polecenia nie wpływa na konfiguracje punktów końcowych programu Windows PowerShell. Get-PSSessionConfiguration Uruchamianie w programie Windows PowerShell pokazuje wszystkie konfiguracje punktów końcowych. Widzimy, że konfiguracje punktów końcowych programu Windows PowerShell nie są wyłączone.

Disable-PSRemoting -Force
powershell.exe -command 'Get-PSSessionConfiguration'

WARNING: PowerShell remoting has been disabled only for PowerShell 6+ configurations and does not affect
 Windows PowerShell remoting configurations. Run this cmdlet in Windows PowerShell to affect all PowerShell
 remoting configurations.

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

Name          : microsoft.powershell
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
                Management Users AccessAllowed

Name          : microsoft.powershell.workflow
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Name          : microsoft.powershell32
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
                Management Users AccessAllowed

Name          : PowerShell.6
PSVersion     : 6.2
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Name          : PowerShell.6.2.2
PSVersion     : 6.2
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

powershell.exe -command 'Disable-PSRemoting -Force'
powershell.exe -command 'Get-PSSessionConfiguration'

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or
Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the
Administrators group on the computer.

Name          : microsoft.powershell
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Name          : microsoft.powershell.workflow
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management
                Users AccessAllowed

Name          : microsoft.powershell32
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Name          : PowerShell.6
PSVersion     : 6.2
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Name          : PowerShell.6.2.2
PSVersion     : 6.2
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators
                AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

Aby wyłączyć te konfiguracje punktów końcowych, Disable-PSRemoting należy uruchomić polecenie z poziomu sesji programu Windows PowerShell. Teraz uruchom polecenie z poziomu programu Windows PowerShell pokazuje, Get-PSSessionConfiguration że wszystkie konfiguracje punktów końcowych są wyłączone.

Przykład 7: Zapobieganie zdalnym dostępowi do konfiguracji sesji, które mają niestandardowe deskryptory zabezpieczeń

W tym przykładzie Disable-PSRemoting pokazano, że polecenie cmdlet wyłącza dostęp zdalny do wszystkich konfiguracji sesji, które obejmują konfiguracje sesji z niestandardowymi deskryptorami zabezpieczeń.

Register-PSSessionConfigurationtworzy konfigurację sesji testowej. Parametr FilePath określa plik konfiguracji sesji, który dostosowuje sesję. Parametr ShowSecurityDescriptorUI wyświetla okno dialogowe, które ustawia uprawnienia do konfiguracji sesji. W oknie dialogowym Uprawnienia tworzymy niestandardowe uprawnienia pełnego dostępu dla wskazanego użytkownika.

Polecenia Get-PSSessionConfiguration cmdlet i Format-Table wyświetlają konfiguracje sesji i ich właściwości. Dane wyjściowe pokazują, że konfiguracja sesji testowej umożliwia interakcyjny dostęp i specjalne uprawnienia dla wskazanego użytkownika.

Disable-PSRemoting wyłącza dostęp zdalny do wszystkich konfiguracji sesji.

Register-PSSessionConfiguration -Name Test -FilePath .\TestEndpoint.pssc -ShowSecurityDescriptorUI -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap

Disable-PSRemoting -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap
New-PSSession -ComputerName localhost -ConfigurationName Test

Name               Permission
----               ----------
PowerShell.6       NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed,
                   BUILTIN\Remote Management Users AccessAllowed
PowerShell.6.2.0   NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed,
                   BUILTIN\Remote Management Users AccessAllowed
Test               NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed,
                   User01 AccessAllowed

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

Name               Permission
----               ----------
PowerShell.6       NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed,
                   BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed
PowerShell.6.2.0   NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed,
                   BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed
Test               NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed,
                   BUILTIN\Administrators AccessAllowed, User01 AccessAllowed

New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message
 : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ComputerName localhost -ConfigurationName Test
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Management.A\u2026tion.RemoteRunspace:RemoteRunspace)
 [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

Teraz polecenia Get-PSSessionConfiguration cmdlet i Format-Table pokazują, że deskryptor zabezpieczeń AccessDenied dla wszystkich użytkowników sieciowych jest dodawany do wszystkich konfiguracji sesji, w tym do konfiguracji sesji testowej. Mimo że inne deskryptory zabezpieczeń nie są zmieniane, deskryptor zabezpieczeń "network_deny_all" ma pierwszeństwo. Jest to zilustrowane przez próbę New-PSSession nawiązania połączenia z konfiguracją sesji testowej.

Przykład 8. Ponowne włączanie dostępu zdalnego do wybranych konfiguracji sesji

W tym przykładzie pokazano, jak ponownie włączyć dostęp zdalny tylko do wybranych konfiguracji sesji. Po wyłączeniu wszystkich konfiguracji sesji ponownie włączymy określoną sesję.

Polecenie Set-PSSessionConfiguration cmdlet służy do zmiany konfiguracji sesji programu PowerShell.6 . Parametr AccessMode z wartością Remote ponownie umożliwia zdalny dostęp do konfiguracji.

Disable-PSRemoting -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -AutoSize

Set-PSSessionConfiguration -Name PowerShell.6 -AccessMode Remote -Force
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -AutoSize

WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting
 or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps:
    1. Stop and disable the WinRM service.
    2. Delete the listener that accepts requests on any IP address.
    3. Disable the firewall exceptions for WS-Management communications.
    4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to
       members of the Administrators group on the computer.

Name                 Permission
----                 ----------
PowerShell.6         NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Adm ...
PowerShell.6.2.0     NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Adm ...

Name                 Permission
----                 ----------
PowerShell.6         NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\ ...
PowerShell.6.2.0     NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Adm ...

Parametry

-Confirm

Monituje o potwierdzenie przed uruchomieniem polecenia cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Wymusza uruchomienie polecenia bez monitowania o potwierdzenie użytkownika.

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

-WhatIf

Pokazuje, co się stanie po uruchomieniu polecenia cmdlet. Polecenie cmdlet nie zostało uruchomione.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Dane wejściowe

None

Nie można potokować obiektów do tego polecenia cmdlet.

Dane wyjściowe

None

To polecenie cmdlet nie zwraca żadnych danych wyjściowych.

Uwagi

To polecenie cmdlet jest dostępne tylko na platformach windows.

  • Wyłączenie konfiguracji sesji nie powoduje cofnięcia wszystkich zmian wprowadzonych przez Enable-PSRemoting polecenia cmdlet lub Enable-PSSessionConfiguration . Może być konieczne ręczne cofnięcie następujących zmian.

    1. Zatrzymaj i wyłącz usługę WinRM.
    2. Usuń odbiornik, który akceptuje żądania na dowolnym adresie IP.
    3. Wyłącz wyjątki zapory dla komunikacji WS-Management.
    4. Przywróć wartość LocalAccountTokenFilterPolicy na 0, co ogranicza zdalny dostęp do członków grupy Administracja istrators na komputerze.
  • Konfiguracja punktu końcowego sesji to grupa ustawień, które definiują środowisko dla sesji. Każda sesja łącząca się z komputerem musi używać jednej z konfiguracji punktu końcowego sesji zarejestrowanych na komputerze. Odmawiając dostępu zdalnego do wszystkich konfiguracji punktów końcowych sesji, można skutecznie uniemożliwić zdalnym użytkownikom ustanawianie sesji łączących się z komputerem.