Anything Goes
Please visit chatisto.com

blablablabla

View previous topic View next topic Go down

blablablabla

Post by captaincook on Mon Nov 27, 2017 10:38 pm

Pokrenite snimanje transkripta na DC1 i CL1 računalima.
Start-Transcript C:\PS-transcript-CLI1.txt

Instalirati dodatne komponente PS-a s DVD-a.
Import-Module -Name (putanja)

Testirajte vezu prema LON-DC1 u obliku true/false rezultata.
Test-Connection -ComputerName LON-DC1 -Quiet

Kreirati self signed certifikat.
New-SelfSignedCertificate -DnsName "www.cert.com" -CertStoreLocation "Cert:\LocalMachine\My"

Napraviti novi OU po imenu Maloprodaja.
New-ADOrganizationalUnit -Name Maloprodaja

Postaviti IP adresu na LON-CL1 računalu na 172.16.1.15/16.
New-NetIPAddress -InterfaceIndex 3 -IPAddress 172.16.0.15 -PrefixLength 16 -DefaultGateway 172.16.0.10

Ispisati listu event ID 4624 događaja s datumom zapisivanja, ID-em i sadržajem poruke. Prikazati i zadnjih 10 poruka s prikazom detalja sadržaja poruke.
Get-EventLog -LogName Application -InstanceId 15
Get-EventLog -LogName Application -InstanceId 15 | Select-Object TimeWritten, InstanceId,       Message
Get-EventLog -LogName Application -InstanceId 15 | Get-member

Napraviti 100 random brojeva.
1..100 | foreach-object {Get-Random}

Kreirati novi folder C:\ScriptShare na \\LON-DC1\C$ korištenjem New-Item naredbe.
New-Item  -ItemType Directory -Name ScriptShare \\LON-DC1\C$

Mapirati C:\ScriptShare kao novi ScriptShare PSDrive.
New-PSDrive -Name "ScriptShare" -PSProvider "FileSystem" -Root '\\LON-DC1\C$\ScriptShare'

Spojiti novi PSDrive po imenu AdatumUsers na „CN=Users,DC=Adatum,DC=com“.
Import-Module ActiveDirectory
New-PSDrive -Name AdatumUsers -PSProvider ActiveDirectory -Root "CN=Users,DC=adatum,DC=com"

Pozicionirati se unutar njega, te kreirati „London Developers“ grupu.
Set-Location AdatumUsers:
New-AdGroup -Name “London Developers“ -GroupScope Global

Kreirati varijablu $today koja sadrži današnji datum. U $logFile varijablu pohraniti datum iz $today varijable u formatu Year-Month-Day-Hour-Minute.txt
$today=get-date
$logFile=[string]$today.Year+ "-"+$today.Month+"-"$today.Day

Napraviti polje podataka $computers, te unutar njega dodati Racunalo1,Racunalo2...........Racunalo98,Racunalo99.
[System.Collections.ArrayList]$computers="Racunalo1","Racunalo2"
$Computers.Add("Racunalo3")
$brojac=0
for ($brojac;$brojac -lt 100;$brojac++) {
$computers.Add("Racunalo$brojac")
}
$computers

Podacima iz $computers polja kreirati nova računala u OU Maloprodaja.
Foreach ($computer in $computers)
{
New-ADComputer -Name $computer -Path "CN=Maloprodaja,DC=adatum,DC=com"
}

Napraviti skriptu u koja sadrži funkciju Generate-Email, a koja prihvaća ili traži ime i prezime, te od toga stvara email adresu u obliku ime.prezime@adatum.com i prikazuje je na ekranu.
function Generate-Email {
param (
[string]$Ime = (Read-Host "Upišite Vaše ime"),
[string]$Prezime = (Read-Host "Upišite Vaše prezime" )
)
$mail=$Ime+"."+$Prezime+"@"+"adatum.com"
Write-Host $mail
}

Pokrenuti background job koji ispisuje rekurzivnu file listu C:\ foldera, te zajedno s veličinom datoteka ispisuje u uzlaznu datototeku popis.txt.
Start-Job -Name Ispis -ScriptBlock {Get-ChildItem C:\ -Recurse -File | select Name, Length | sort Length | Tee-Object C:\popis.txt}

captaincook
New Member
New Member

Posts : 1
Join date : 2015-05-23

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum