SHARE
TWEET

Untitled

a guest Aug 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pocetak transkripta i njegovo pohranjivanje, append sluzi tome da se ne napravi svaki puta drugi file nego uvijek se nadodaju vrijednosti u istome
  2. Start-Transcript C:\Users\Administrator\Documents\PowerShell_transcript.csv -Append
  3. Import-Module ActiveDirectory
  4.  
  5. #brojanje racunala i servera koji se nalaze u organizacijskoj jedinici koji se prebacuju
  6. $serveri = Get-ADComputer -SearchBase "OU=NovaRacunala,DC=crveni,DC=tim" -Filter {OperatingSystem -like "*Server*"} | Measure-Object
  7. $racunala = Get-ADComputer -SearchBase "OU=NovaRacunala,DC=crveni,DC=tim" -Filter {OperatingSystem -like "*10*"} | Measure-Object
  8.  
  9. #skoro pa isti kod koji se bavi ucitavanjem i prebacivanjem racunala i servera iz jedne organizacijske jedinice u njihove zasebne
  10. #zasluzne za servere i racunala
  11. Get-ADComputer -SearchBase "OU=NovaRacunala,DC=crveni,DC=tim" -Filter {OperatingSystem -like "*Server*"} |
  12. Move-ADObject -TargetPath "OU=Serveri,DC=crveni,DC=tim"
  13. Get-ADComputer -SearchBase "OU=NovaRacunala,DC=crveni,DC=tim" -Filter {OperatingSystem -like "*10*"} |
  14. Move-ADObject -TargetPath "OU=Racunala,DC=crveni,DC=tim"
  15.  
  16. #ispisuje broj prenesenih racunala i servera koji su izbrojani na pocetku
  17. Write-Output 'Broj prenesenih servera je:' $serveri.count
  18. Write-Output 'Broj prenesenih racunala je: ' $racunala.count
  19.  
  20. #timestamp i zaustavljanje transkripta
  21. Get-Date
  22. Stop-Transcript
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top