Section 2 - Power Shell Flashcards
What are powershells main verbs?
get
set
copy
move
new
add (like adding user to group)
How to go forwards and backwards through commands that powershell tries to auto compete?
tab
shift
This is done through intelisense
Get services then start and stop the Remote Management service
What would this service be known as in terms of powershell
Show the man page for stop-service
get-service
WinRM
stop-service -name “winrm”
start-service -name “winrm”
-name would be a parameter
winrm is a parameter
get-help stop-service
Show running processes
show the 5 newest system event logs
Change the formatting of this so you can see more information
Send this info to a text file
get-process
get-eventlog -logname system -newest 5 | format-list | out-file c:\log.txt
(this is normally formatted as a table)
Show all commands
Show a command that contains the word “net” and also the word “reset”
get-commands -noun net* -verb reset (use a wildcard)
Show current modules
What are they?
import activedirectory module
Where would you find downloadable modules?
download a command
They contain tons of commands
get-module
import-module -name activedirectory
powershellgallery.com
search what you want, click on it, copy the command that will download it
What is a forest, tree, and a forest?
Every Active Directory Domain must be part of a forest and a tree.
Tree - every child domain that contains the parents name
Forest - Domains in forest contain same schema. Schema makes up all objects and attributes. Multiple forests can be linked, but they won’t have the same schema, you can add a trust though
Why have multiple domains?
Big company over different countries
What would your child domain called UK be called in AD if your first domain was examlabpractice.com
What about if UK has a child domain?
uk.examlabpractice.com
scotland.uk.examlabpractice.com
What is a trust relationship
Domains can share resources
Why go to multiple trees?
If a different naming convention needs to be used.
What can domains part of the same forest share?
Resources - files, folders, printers
Scheme - Object templates and attributes (like you can look up a user in a different county in a same forest)
Where is the Active Directory database stored?
What partitions does this consist of?
NTDS.dir
Configuration - Replicates to every DC in Forest. Has info how forest is configured.
Schema - Makes all object and attributes for entire forest. IE: Has info on how to build users, groups, etc. It has a bunch of templates/blueprints basically. Replicates forest wide.
Domain - Unique per domain. Users, passwords, groups, etc. all stored here for your unique Domain. Replicates to only DCs in this domain.
Application (custom) - You can create this and choose what is stored here. For custom made objects and you can choose which DCs replicate this.
These two are actually in here:
-ForestDNSZone
-DomainDNSZone
What is the Global Catalog
Special job you can assign to a DC that replicates a subset of all objects in every domain’s “Domain” partition.
Purpose - Different computers can locate object in different domain.
I can look up a user if I’m in Australia for a domain in the US, but it won’t have all attributes about the object, just the subsets of objects.
IMPORTANT
Just to be safe, create a domain name that is unique. If you copy someone else’s and integrate to the cloud this could cause problems