{"id":298,"date":"2017-11-26T19:56:14","date_gmt":"2017-11-26T18:56:14","guid":{"rendered":"http:\/\/darko-keric.from.hr\/?p=298"},"modified":"2017-11-26T19:56:14","modified_gmt":"2017-11-26T18:56:14","slug":"powershell","status":"publish","type":"post","link":"http:\/\/darko-keric.from.hr\/?p=298","title":{"rendered":"powershell"},"content":{"rendered":"<p>slmgr \/rearm #rearm da se ne gasi<\/p>\n<p>1. Test-Connection -ComputerName LON-DC1 -Quiet<br \/>\n2. New-SelfSignedCertificate -DnsName &#8220;www.cert.com&#8221; -CertStoreLocation &#8220;Cert:\\\\LocalMachine\\\\My&#8221;<br \/>\n3. New-ADOrganizationalUnit -Name Maloprodaja<br \/>\n4. New-NetIPAddress -InterfaceIndex 3 -IPAddress 172.16.0.15 -PrefixLength 16 -DefaultGateway 172.16.0.10<br \/>\n5. Get-EventLog -LogName Application -InstanceId 15<br \/>\nGet-EventLog -LogName Application -InstanceId 15 | Select-Object TimeWritten, InstanceId , Message<br \/>\nGet-EventLog -LogName Application -InstanceId 15 | Get-member #za popis atributa i objekata<br \/>\n6. 1..100 | foreach-object {Get-Random} ili brojac u petlji<br \/>\n7. New-Item -ItemType Directory -Name ScriptShare \\\\\\\\LON-DC1\\\\C$<br \/>\n8. New-PSDrive -Name &#8220;ScriptShare&#8221; -PSProvider &#8220;FileSystem&#8221; -Root &#8216;\\\\\\\\LON-DC1\\\\C$\\\\ScriptShare&#8217;<br \/>\n9. Import-module ActiveDirectory<br \/>\ncd AD:<br \/>\nNw-PSDrive -PSProvider ActiveDirectory -Name &#8220;AdatumUsers&#8221; -Root &#8220;cn=users,dc=adatum,dc=com&#8221;<br \/>\n10.New-Item -ItemType group -Path &#8220;cn=London Developers&#8221;<br \/>\n11. $today=get-date<br \/>\n$logFile=[string]$today.Year+ &#8220;-&#8220;+$today.Month+&#8221;-&#8220;$today.Day<br \/>\n12. [System.Collections.ArrayList]$computers=&#8221;Racunalo1&#8243;,&#8221;Racunalo2&#8221;<br \/>\n$Computers.Add(&#8220;Racunalo3&#8221;)<br \/>\n$brojac=0<br \/>\nfor ($brojac;$brojac -lt 100;$brojac++) {<br \/>\n$computers.Add(&#8220;Racunalo$brojac&#8221;)<br \/>\n}<br \/>\n$computers<br \/>\n13. function Generate-Email {param<br \/>\n(<br \/>\n[string]$ime= (Read-Host &#8220;Upi\u0161ite ime&#8221;),<br \/>\n[string]$prezime = (Read-Host &#8220;Upi\u0161ite prezime&#8221;)<br \/>\n)<br \/>\n$mail=$ime+&#8221;.&#8221;+$prezime+&#8221;@&#8221;+&#8221;adatum.com&#8221;<br \/>\nWrite-Host $mail<br \/>\n}<br \/>\nGenerate-Email<br \/>\n14. Start-Job -Name Ispis -ScriptBlock {Get-ChildItem c:\\ -Recurse -File | select Name, Lenght | sort Lenght | Tee-Object c:\\popis.txt}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>slmgr \/rearm #rearm da se ne gasi 1. Test-Connection -ComputerName LON-DC1 -Quiet 2. New-SelfSignedCertificate -DnsName &#8220;www.cert.com&#8221; -CertStoreLocation &#8220;Cert:\\\\LocalMachine\\\\My&#8221; 3. New-ADOrganizationalUnit -Name Maloprodaja 4. New-NetIPAddress -InterfaceIndex 3 -IPAddress 172.16.0.15 -PrefixLength 16 -DefaultGateway 172.16.0.10 5. Get-EventLog -LogName Application -InstanceId 15 Get-EventLog -LogName &hellip; <a href=\"http:\/\/darko-keric.from.hr\/?p=298\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":348,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[6],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/darko-keric.from.hr\/?p=298\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"powershell - Sistemski in\u017eenjer\" \/>\n<meta property=\"og:description\" content=\"slmgr \/rearm #rearm da se ne gasi 1. Test-Connection -ComputerName LON-DC1 -Quiet 2. New-SelfSignedCertificate -DnsName &#8220;www.cert.com&#8221; -CertStoreLocation &#8220;Cert:\\\\LocalMachine\\\\My&#8221; 3. New-ADOrganizationalUnit -Name Maloprodaja 4. New-NetIPAddress -InterfaceIndex 3 -IPAddress 172.16.0.15 -PrefixLength 16 -DefaultGateway 172.16.0.10 5. Get-EventLog -LogName Application -InstanceId 15 Get-EventLog -LogName &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/darko-keric.from.hr\/?p=298\" \/>\n<meta property=\"og:site_name\" content=\"Sistemski in\u017eenjer\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-26T18:56:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"darko-keric\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/darko-keric.from.hr\/#website\",\"url\":\"https:\/\/darko-keric.from.hr\/\",\"name\":\"Sistemski in\\u017eenjer\",\"description\":\"System administrator\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/darko-keric.from.hr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/darko-keric.from.hr\/?p=298#webpage\",\"url\":\"http:\/\/darko-keric.from.hr\/?p=298\",\"name\":\"powershell - Sistemski in\\u017eenjer\",\"isPartOf\":{\"@id\":\"https:\/\/darko-keric.from.hr\/#website\"},\"datePublished\":\"2017-11-26T18:56:14+00:00\",\"dateModified\":\"2017-11-26T18:56:14+00:00\",\"author\":{\"@id\":\"https:\/\/darko-keric.from.hr\/#\/schema\/person\/5e2f76737b07a700e0e2a108d173e612\"},\"breadcrumb\":{\"@id\":\"http:\/\/darko-keric.from.hr\/?p=298#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/darko-keric.from.hr\/?p=298\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/darko-keric.from.hr\/?p=298#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/darko-keric.from.hr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"powershell\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/darko-keric.from.hr\/#\/schema\/person\/5e2f76737b07a700e0e2a108d173e612\",\"name\":\"darko-keric\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/darko-keric.from.hr\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/0400800f6ebec266fcb39a1cb31b0b0e?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/0.gravatar.com\/avatar\/0400800f6ebec266fcb39a1cb31b0b0e?s=96&d=mm&r=g\",\"caption\":\"darko-keric\"},\"url\":\"http:\/\/darko-keric.from.hr\/?author=348\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/darko-keric.from.hr\/?p=298","og_locale":"en_US","og_type":"article","og_title":"powershell - Sistemski in\u017eenjer","og_description":"slmgr \/rearm #rearm da se ne gasi 1. Test-Connection -ComputerName LON-DC1 -Quiet 2. New-SelfSignedCertificate -DnsName &#8220;www.cert.com&#8221; -CertStoreLocation &#8220;Cert:\\\\LocalMachine\\\\My&#8221; 3. New-ADOrganizationalUnit -Name Maloprodaja 4. New-NetIPAddress -InterfaceIndex 3 -IPAddress 172.16.0.15 -PrefixLength 16 -DefaultGateway 172.16.0.10 5. Get-EventLog -LogName Application -InstanceId 15 Get-EventLog -LogName &hellip; Continue reading &rarr;","og_url":"http:\/\/darko-keric.from.hr\/?p=298","og_site_name":"Sistemski in\u017eenjer","article_published_time":"2017-11-26T18:56:14+00:00","twitter_card":"summary","twitter_misc":{"Written by":"darko-keric","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/darko-keric.from.hr\/#website","url":"https:\/\/darko-keric.from.hr\/","name":"Sistemski in\u017eenjer","description":"System administrator","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/darko-keric.from.hr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/darko-keric.from.hr\/?p=298#webpage","url":"http:\/\/darko-keric.from.hr\/?p=298","name":"powershell - Sistemski in\u017eenjer","isPartOf":{"@id":"https:\/\/darko-keric.from.hr\/#website"},"datePublished":"2017-11-26T18:56:14+00:00","dateModified":"2017-11-26T18:56:14+00:00","author":{"@id":"https:\/\/darko-keric.from.hr\/#\/schema\/person\/5e2f76737b07a700e0e2a108d173e612"},"breadcrumb":{"@id":"http:\/\/darko-keric.from.hr\/?p=298#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/darko-keric.from.hr\/?p=298"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/darko-keric.from.hr\/?p=298#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/darko-keric.from.hr\/"},{"@type":"ListItem","position":2,"name":"powershell"}]},{"@type":"Person","@id":"https:\/\/darko-keric.from.hr\/#\/schema\/person\/5e2f76737b07a700e0e2a108d173e612","name":"darko-keric","image":{"@type":"ImageObject","@id":"https:\/\/darko-keric.from.hr\/#personlogo","inLanguage":"en-US","url":"http:\/\/0.gravatar.com\/avatar\/0400800f6ebec266fcb39a1cb31b0b0e?s=96&d=mm&r=g","contentUrl":"http:\/\/0.gravatar.com\/avatar\/0400800f6ebec266fcb39a1cb31b0b0e?s=96&d=mm&r=g","caption":"darko-keric"},"url":"http:\/\/darko-keric.from.hr\/?author=348"}]}},"_links":{"self":[{"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/posts\/298"}],"collection":[{"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/users\/348"}],"replies":[{"embeddable":true,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298"}],"version-history":[{"count":1,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":299,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions\/299"}],"wp:attachment":[{"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darko-keric.from.hr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}