snipt

Ctrl+h for KB shortcuts

Text only

AD User group list

(Get-QADUser user).memberOf | Get-QADGroup | select name
https://snipt.net/embed/37b83fc3256a6590e3fb749e239ef63b/
/raw/37b83fc3256a6590e3fb749e239ef63b/
37b83fc3256a6590e3fb749e239ef63b
text
Text only
1
2019-08-24T13:43:43
True
False
False
/api/public/snipt/11762/
ad-user-group-list
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>(Get-QADUser user).memberOf | Get-QADGroup | select name </span></pre></div> </td></tr></table>
ad, ps

Text only

Create EventLog Entry

$creationData = new-object System.Diagnostics.EventSourceCreationData "AppName", "LogName"$creationData.MachineName = "TargetServerName"[System.Diagnostics.EventLog]::CreateEventSource($creationData)
https://snipt.net/embed/312dc57fd947d3b7fcb78bef81a7bceb/
/raw/312dc57fd947d3b7fcb78bef81a7bceb/
312dc57fd947d3b7fcb78bef81a7bceb
text
Text only
1
2019-08-14T11:22:06
True
False
False
/api/public/snipt/2247/
create-eventlog-entry
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$creationData = new-object System.Diagnostics.EventSourceCreationData &quot;AppName&quot;, &quot;LogName&quot;$creationData.MachineName = &quot;TargetServerName&quot;[System.Diagnostics.EventLog]::CreateEventSource($creationData) </span></pre></div> </td></tr></table>
eventlog, ps

Text only

Ping more than one server

("viper1", "viper2", "viper3") % {ping -n 1 $_}
https://snipt.net/embed/042dfd0bff7ba1f21794135d46cbfe50/
/raw/042dfd0bff7ba1f21794135d46cbfe50/
042dfd0bff7ba1f21794135d46cbfe50
text
Text only
1
2019-08-14T11:13:18
True
False
False
/api/public/snipt/2013/
ping-more-than-one-server
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>(&quot;viper1&quot;, &quot;viper2&quot;, &quot;viper3&quot;) % {ping -n 1 $_} </span></pre></div> </td></tr></table>
networking, ps

Text only

Progress Bar

1
2
3
4
5
6
7
for ($a=1; $a -lt 100; $a++) {
  Write-Progress -Activity "Working..." `
   -PercentComplete $a -CurrentOperation
   "$a% complete" `
   -Status "Please wait."
  Start-Sleep 1
}
https://snipt.net/embed/63d8602c4664fb245dab21b8d2f6f60d/
/raw/63d8602c4664fb245dab21b8d2f6f60d/
63d8602c4664fb245dab21b8d2f6f60d
text
Text only
8
2019-08-19T23:53:08
True
False
False
/api/public/snipt/1986/
progress-bar
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>for ($a=1; $a -lt 100; $a++) { </span><span id="L-2"><a name="L-2"></a> Write-Progress -Activity &quot;Working...&quot; ` </span><span id="L-3"><a name="L-3"></a> -PercentComplete $a -CurrentOperation </span><span id="L-4"><a name="L-4"></a> &quot;$a% complete&quot; ` </span><span id="L-5"><a name="L-5"></a> -Status &quot;Please wait.&quot; </span><span id="L-6"><a name="L-6"></a> Start-Sleep 1 </span><span id="L-7"><a name="L-7"></a>} </span></pre></div> </td></tr></table>
operations, ps

Text only

Ping Range

0..255 | % { $ip = "192.168.2.$_"; "$ip = $(ping-ip $ip)" }
https://snipt.net/embed/0804123d7f3884af8cba897a2a04894c/
/raw/0804123d7f3884af8cba897a2a04894c/
0804123d7f3884af8cba897a2a04894c
text
Text only
1
2019-08-19T11:22:08
True
False
False
/api/public/snipt/1985/
ping-range
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>0..255 | % { $ip = &quot;192.168.2.$_&quot;; &quot;$ip = $(ping-ip $ip)&quot; } </span></pre></div> </td></tr></table>
networking, ps

Text only

Chart-DiskSpace

http://powershell.com/cs/media/p/467.aspx
https://snipt.net/embed/3218cd26cbd0db14286ebf36bad47c03/
/raw/3218cd26cbd0db14286ebf36bad47c03/
3218cd26cbd0db14286ebf36bad47c03
text
Text only
1
2019-08-17T12:15:57
True
False
False
/api/public/snipt/1598/
chart-diskspace
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>http://powershell.com/cs/media/p/467.aspx </span></pre></div> </td></tr></table>
ps, reporting