<div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2526 " id="quads-ad2526" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 <h1>The Story (Finding Domain Joined Servers Services users)</h1><p>If you&rsquo;re wondering which of your servers are using domain joined account or a non regular account like network service or system. You will need to go through every server&rsquo;s service console and check that one by one but thanks to PowerShell this job was made like a piece of cake.</p><div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2524 " id="quads-ad2524" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 </div><div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2529 " id="quads-ad2529" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 </div><div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2523 " id="quads-ad2523" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 </div><h2>Requirement</h2><p>The requirement to run this script is a domain admin account since the PowerShell will require access to other servers using Remote PowerShell using Invoke command and run a Get-WMIObject script to find out those details. So in short I will write the required things for this to work</p><p>1- Logged in to Active Directory <strong>(In order for AD PowerShell module to run and find computers).</strong></p><p>2- Domain admin account <strong>(To run the remote PowerShell on other servers and get service details)</strong></p><p>3- Firewall for domain joined computers is open <strong>(To allow remote PowerShell to work)</strong> or have remote PowerShell enabled via GPO.</p><p>The Script will also show you the offline <strong>(inaccessible servers)</strong> and will state those servers as down as you can see in the screenshot below.</p><p>The script will also prompt you for a path to save the output. You can enter something like C:\Services.csv ; as soon as you type the file path and extension it&rsquo;ll be opened using Notepad.</p><p><a href="https://www.moh10ly.website/wp-content/uploads/2019/08/image.png"><img title="image" src="https://www.moh10ly.website/wp-content/uploads/2019/08/image_thumb.png" alt="image" width="1028" height="122" border="0"></a> 
</p><div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2527 " id="quads-ad2527" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 </div><blockquote><p>#Check servers down and get services from the responsive servers</p>
<p>$Computers = Get-ADComputer -Filter { OperatingSystem -Like &lsquo;*Windows Server*&rsquo;}</p>
<p>$Input = ForEach ($computer in $computers){</p>
<p>$comp = $Computer.DNSHostName</p>
<p>$dist = $Computer.DistinguishedName</p>
<p>if (Test-Connection -Computername $comp -count 2 -Quiet )</p>
<p>{</p>
<p>Invoke-Command -ComputerName $comp -ScriptBlock {Get-WmiObject win32_service | where {$_.StartName -notlike &ldquo;*LocalSystem*&rdquo; -and $_.StartName -notlike &ldquo;*LocalService*&rdquo; -and $_.StartName -notlike &ldquo;*NetworkService*&rdquo; -and $_.StartName -notlike &ldquo;*System*&rdquo;} | select DisplayName,StartName,State }}</p>
<p>else{ Write-host $comp is down -foregroundColor red -BackGroundColor black</p>
<p>}</p>
<p>}</p>
<p>$Output = Read-Host &ldquo;Enter File path and Name to save output to&rdquo;</p>
<p>Out-File -FilePath $Output -InputObject $Input -Encoding ascii</p>
<p>Notepad $Output</p></blockquote><p><a href="https://www.moh10ly.website/wp-content/uploads/2019/08/image-1.png"><br>
<img title="image" src="https://www.moh10ly.website/wp-content/uploads/2019/08/image_thumb-1.png" alt="image" width="760" height="251" border="0"></a></p><div> 
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2531 " id="quads-ad2531" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 </div><p><a href="https://www.moh10ly.website/wp-content/uploads/2019/08/image-2.png"><img title="image" src="https://www.moh10ly.website/wp-content/uploads/2019/08/image_thumb-2.png" alt="image" width="1028" height="340" border="0"></a></p></div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2530 " id="quads-ad2530" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>


Reset and manage your Active Directory users' Passwords Active Directory is one of the most…
Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…
If you're using a Proxy server in your firewall or in your network and have…
Story:I got some clients that have reported some of their users being locked out and…
Delegate Permissions This is a code that I have wrote recently to check if an…
Story: I got a request from a client who constantly gets CVs and have to…
View Comments