getting the pasword does not meet the complexity make a paramater for the file p
ID: 3540444 • Letter: G
Question
getting the pasword does not meet the complexity
make a paramater for the file
param([string]$filePath)
#############################
#FUNCTION 1 - Create OU - 6points
Function newOU($OU)
{
if(!(Get-ADOrganizationalUnit -filter {name -eq $OU}))
{
New-ADOrganizationalUnit -name $OU -path $ADDomainName
"$OU has now been created."
}
else
{
"$OU has already been created."
}
write-host
}
#############################
#FUNCTION 2 - Create Group/Verify group exists - 4points
Function createGroup($ADgroup,$ADDomainName,$OU)
{
if (!(Get-ADGroup -filter{name -eq $ADgroup}))
{
"The $ADgroup group is being created."
new-ADGroup -name $ADgroup -groupcategory Security `
-groupscope Global -path "OU =$OU,$ADDomainName"
}
}
#############################
#FUNCTION 3 - Create Users - 12points
Function newUser ($account,$fname,$lname,$desc,$pwd,$mgr,$OU,$ADDomainName, $ADgroup)
{
if(!(Get-ADUser -filter {name -eq $account}))
{
if(!$mgr)
{
"Adding User $account.`n Full name is $fname $lname."
New-ADUser $account -givenname $fname -surname $lname -description $desc -enabled 1 `
-displayname ($fname +" "+ $lname) -accountpassword $pwd -changepasswordatlogon $true `
-path "OU=$OU,$ADDomainName"
}
else
{
"Adding User $account ($mgr will be the manager)."
new-ADUser $account -givenname $fname -surname $lname -description $desc -enabled 1 `
-displayname ($fname +" "+ $lname) -accountpassword $pwd -changepasswordatlogon $true `
-path "OU=$OU,$ADDomainName"
}
}
}
Explanation / Answer
a
Get-Acl Get permission settings for a file or registry key
Set-Acl Set permissions
Active Directory Account, Computer, Group and User cmdlets
Get-Alias gal Return alias names for Cmdlets
Import-Alias ipal Import an alias list from a file
New-Alias nal Create a new alias.
Set-Alias sal Create or change an alias
Get-AuthenticodeSignature Get the signature object associated with a file
Set-AuthenticodeSignature Place a signature in a .ps1 script or other file
b
Begin Function BEGIN block
BITS Background Intelligent Transfer Service cmdlets
c
Set-Location cd/chdir/sl Set the current working location
Get-ChildItem dir/ls/gci Get child items (contents of a folder or registry key)
Clear-Host clear/cls Clear the screen
Clear-Item cli Remove content from a variable or an alias
Get-Command gcm Retrieve basic information about a command
Measure-Command Measure running time
Trace-Command Trace an expression or command
Add-Computer Add a computer to the domain
Checkpoint-Computer Create a system restore point (XP)
Remove-Computer Remove the local computer from a workgroup or domain
Restart-Computer Restart the operating system on a computer
Restore-Computer Restore the computer to a previous state
Stop-Computer Stop (shut down) a computer
Reset-ComputerMachinePassword Reset the machine account password for the computer
Test-ComputerSecureChannel Test and repair the secure channel to the domain
Add-Content ac Add to the content of the item
Get-Content cat/type/gc Get content from item (specific location)
Set-Content sc Set content in the item (specific location)
Clear-Content clc Remove content from a file/item
Get-Command gcm Get basic information about cmdlets
Invoke-Command icm Run command
Enable-ComputerRestore Enable System Restore on a drive
Disable-ComputerRestore Disable System Restore on a drive
Get-ComputerRestorePoint Get the restore points on the local computer
Test-Connection Ping one or more computers
ConvertFrom-CSV Convert object properties (in CSV format) into CSV objects
ConvertTo-CSV Convert .NET Framework objects into CSV variable-length strings
ConvertTo-Html Convert the input into an HTML table
ConvertTo-Xml Convert the input into XML
ConvertFrom-SecureString Convert a secure string into an encrypted standard string
ConvertTo-SecureString Convert an encrypted standard string into a secure string
Copy-Item copy/cp/ci Copy an item from a namespace location
Export-Counter Export Performance Counter data to log files
Get-Counter Get performance counter data
Import-Counter Import performance counter log files
Get-Credential Get a security credential (username/password)
Get-Culture Get region information (language and keyboard layout)
d
Get-ChildItem Dir/ls/gci Get child items (contents of a folder or registry key)
Get-Date Get current date and time
Set-Date Set system time on the host system
Remove-Item Del/erase/rd/rm/rmdir Delete an item
Compare-Object diff/compare Compare the properties of objects
Do Loop while a condition is True
e
End Function END block
Get-Event Get events in the event queue
Get-WinEvent Get events from event logs and event trace logs
New-Event Create a new event
Remove-Event Delete events from the event queue
Unregister-Event Cancel an event subscription
Wait-Event Wait until a particular event is raised
Clear-EventLog Delete all entries from an event log
Get-Eventlog Get event log data
Limit-EventLog Limit the size of the event log
New-Eventlog Create a new event log and a new event source
Remove-EventLog Delete an event log
Show-EventLog Display an event log
Write-EventLog Write an event to an event log
Get-EventSubscriber Get event subscribers
Register-EngineEvent Subscribe to PowerShell events
Register-ObjectEvent Subscribe to .NET events
Register-WmiEvent Subscribe to a WMI event
Get-ExecutionPolicy Get the execution policy for the shell
Set-ExecutionPolicy Change the execution policy (user preference)
Export-Alias epal Export an alias list to a file
Export-Clixml Produce a clixml representation of PowerShell objects
Export-Console Export console configuration to a file
Export-Csv epcsv Export to Comma Separated Values (spreadsheet)
Exit-PSSession Exit Exit PowerShell (or exit a script)
f
ForEach-Object foreach Loop for each object in the pipeline ( % )
ForEach Loop through values in the pipeline
For Loop through items that match a condition
Format-Custom fc Format output using a customized view
Format-List fl Format output as a list of properties, each on a new line
Format-Table ft Format output as a table
Format-Wide fw Format output as a table listing one property only
Export-FormatData Save formatting data from the current session
Get-FormatData Get the formatting data in the current session
g
Get-Item gi Get a file/registry object (or any other namespace object)
Get-ChildItem dir/ls/gci Get child items (contents of a folder or registry key)
h
Get-Help help Open the help file
Add-History Add entries to the session history
Clear-History clhy Delete entries from the session history
Get-History history/h/ghy Get a listing of the session history
Invoke-History r/ihy Invoke a previously executed Cmdlet
Get-Host Get host information (PowerShell Version and Region)
Clear-Host clear/cls Clear the screen
Read-Host Read a line of input from the host console
Write-Host Write customized output to the host/screen
Get-HotFix Get Installed hotfixes
i
if Conditionally perform a command
Import-Clixml Import a clixml file and rebuild the PS object
Import-Csv ipcsv Take values from a CSV list and send objects down the pipeline
Invoke-Command Run commands on local and remote computers
Invoke-Expression iex Run a PowerShell expression
Get-Item gi Get a file object or get a registry (or other namespace) object
Invoke-Item ii Invoke an executable or open a file (START)
New-Item ni Create a new item in a namespace
Remove-Item rm/del/erase/rd/ri/rmdir Remove an item
Set-Item si Change the value of an item
Clear-ItemProperty clp Remove the property value from a property
Copy-ItemProperty cpp Copy a property along with it's value
Get-ItemProperty gp Retrieve the properties of an object
Move-ItemProperty mp Move a property from one location to another
New-ItemProperty Set a new property
Remove-ItemProperty rp Remove a property and its value
Rename-ItemProperty rnp Renames a property at its location
Set-ItemProperty sp Set a property at the specified location to a specified value
j
Get-Job gjb Get PowerShell background jobs that are running
Receive-Job rcjb Get PowerShell background job results
Remove-Job rjb Delete a PowerShell background job
Start-Job sajb Start a PowerShell background job
Stop-Job spjb Stop a PowerShell background job
Wait-Job wjb Wait for a background job
k
Stop-Process kill/spps Stop a running process
l
Update-List Add and remove items from a collection
Get-Location pwd / gl Get and display the current location
Pop-Location popd Set the current working location from the stack
Push-Location pushd Push a location to the stack
Set-Location cd/chdir/sl Set the current working location
m
Send-MailMessage Send an email message
Add-Member Add a member to an instance of a PowerShell object
Get-Member gm Enumerate the properties of an object
Get-Module gmo Get the modules imported to the session
Import-Module ipmo Add a module to the session
New-Module nmo Create a new dynamic module (only in memory)
Remove-Module rmo Remove a module from the current session
Move-Item mv/move/mi Move an item from one location to another
o
Compare-Object diff/compare Compare the properties of objects
Group-Object group Group objects that contain the same value
Measure-Object Measure the properties of an object
New-Object Create a new .Net object
Select-Object select Select properties of objects
Sort-Object sort Sort objects by property value
Where-Object Filter the objects passed along the command pipeline
Out-Default Send output to default
Out-File Send output to a file
Out-GridView ogv Send output to an interactive table
Out-Host oh Send output to the host
Out-Null Send output to null
Out-Printer lp Send the output to a printer
Out-String Send objects to the host as strings
p
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.