IT Share NVP -ViettechgroupVN-Phuong Nguyen blog Viettechgroup.vn | Share make us stronger Knowledge is Sharing Viettechgroup- Sharing Make Us Stronger-Kiến thức CNTT là sự chia sẻ- NVP-Chia sẻ làm chúng ta mạnh hơn-Viettechgroup.vn Viettechgroup.com.vn| ITShareNVP Channel | Phương Nguyễn | Phuong Nguyen Blog| Lưu trữ kiến thức chia sẽ kinh nghiệm CNTT | Phương Nguyễn

CÁCH KẾT NỐI EXCHANGE SERVER BẰNG REMOTE POWERSHELL-EMS

325

Bước 1:

Để chạy được EMS powershell chúng ta cấp quyền remote

Set-ExecutionPolicy RemoteSigned

$Credentials = Get-Credential

$Credentials = Get-Credential

Bước 2:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://LAB-EX2013.phuongit.lab/PowerShell -Authentication Kerberos -Credential $Credentials

Lưu ý http://<ServerFQDN>/powershell chúng ta thay ServerFQDN của các bạn nhé. Ví dụ ở đây của Phương Nguyễn là LAB-EX2013.phuongit.lab, tường lửa không cấm port 80.

PS C:\Users\Administrator.PHUONGIT> $Credentials = Get-Credential

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\Users\Administrator.PHUONGIT> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:/
/LAB-EX2013.phuongit.lab/PowerShell -Authentication Kerberos -Credential $Credentials
PS C:\Users\Administrator.PHUONGIT> Import-PSSession $Session
WARNING: The names of some imported commands from the module 'tmp_jbe3g1pw.q0h' include unapproved verbs that might
make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the
Verbose parameter. For a list of approved verbs, type Get-Verb.

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0        tmp_jbe3g1pw.q0h                    {Add-ADPermission, Add-AvailabilityAddressSpace, Add-Conte...


PS C:\Users\Administrator.PHUONGIT>

Bước 3:

Import-PSSession $Session

Chờ import xong sẽ ok nhé trường hợp nếu không muốn hiện thì thêm tham số

Import-PSSession $Session -DisableNameChecking

Bước 4: Test Lệnh Exchange PS1 ví dụ

Get-User -ResultSize unlimited -Filter ‘RemotePowerShellEnabled -eq $true’

Để kết thúc phiên làm việc có thể end session

Remove-PSSession $Session

Chúc các bạn thành công

Phương Nguyễn IT viết.

Nguồn: http://phuongnguyenit.com/cach-ket-noi-exchange-server-bang-remote-powershell-ems/

Được đóng lại.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More