forked from GoateePFE/PowerShellSummit2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabJEA-Client.ps1
38 lines (30 loc) · 1.18 KB
/
LabJEA-Client.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
break
#region ==== Test JEA =========================================================
### RUN THESE LINES FROM CLIENT-01
$Domain = $env:USERDOMAIN
$pw = ConvertTo-SecureString -String 'P@ssw0rd' -AsPlainText -Force
$cred_alice = New-Object -TypeName PSCredential -ArgumentList "$Domain\alice",$pw
$cred_bob = New-Object -TypeName PSCredential -ArgumentList "$Domain\bob",$pw
$cred_charlie = New-Object -TypeName PSCredential -ArgumentList "$Domain\charlie",$pw
# Within each of the following three remoting sessions try the following commands.
# Test TAB expansion as you go along.
Get-Command
format C:
Stop-Service NTDS -Force
Get-NetAdapter
Get-NetAdapterStatistics
Get-NetTCPConnection
Get-SmbShare
dir C:\
Get-Disk
Get-Volume
Get-Partition
# try some commands of your own
Exit
# Disks
Enter-PSSession -ComputerName ts1 -ConfigurationName SummitJEA -Credential $cred_alice
# Shares
Enter-PSSession -ComputerName ts1 -ConfigurationName SummitJEA -Credential $cred_bob
# Disks & Shares
Enter-PSSession -ComputerName ts1 -ConfigurationName SummitJEA -Credential $cred_charlie
#endregion ====================================================================