HOW TO GET ALL DOMAIN JOINED SERVER SERVICES THAT USING A UNIQUE OR DOMAIN USER

<div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2526 " id&equals;"quads-ad2526" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <h1>The Story &lpar;Finding Domain Joined Servers Services users&rpar;<&sol;h1><p>If you&rsquo&semi;re wondering which of your servers are using domain joined account or a non regular account like network service or system&period; You will need to go through every server&rsquo&semi;s service console and check that one by one but thanks to PowerShell this job was made like a piece of cake&period;<&sol;p><div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2524 " id&equals;"quads-ad2524" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <&sol;div><div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2529 " id&equals;"quads-ad2529" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <&sol;div><div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2523 " id&equals;"quads-ad2523" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <&sol;div><h2>Requirement<&sol;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&period; So in short I will write the required things for this to work<&sol;p><p>1- Logged in to Active Directory <strong>&lpar;In order for AD PowerShell module to run and find computers&rpar;&period;<&sol;strong><&sol;p><p>2- Domain admin account <strong>&lpar;To run the remote PowerShell on other servers and get service details&rpar;<&sol;strong><&sol;p><p>3- Firewall for domain joined computers is open <strong>&lpar;To allow remote PowerShell to work&rpar;<&sol;strong> or have remote PowerShell enabled via GPO&period;<&sol;p><p>The Script will also show you the offline <strong>&lpar;inaccessible servers&rpar;<&sol;strong> and will state those servers as down as you can see in the screenshot below&period;<&sol;p><p>The script will also prompt you for a path to save the output&period; You can enter something like C&colon;&bsol;Services&period;csv&nbsp&semi; as soon as you type the file path and extension it&rsquo&semi;ll be opened using Notepad&period;<&sol;p><p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image&period;png"><img title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image&lowbar;thumb&period;png" alt&equals;"image" width&equals;"1028" height&equals;"122" border&equals;"0"><&sol;a> &NewLine;<&sol;p><div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2527 " id&equals;"quads-ad2527" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <&sol;div><blockquote><p>&num;Check servers down and get services from the responsive servers<&sol;p>&NewLine;<p>&dollar;Computers &equals; Get-ADComputer -Filter &lbrace; OperatingSystem -Like &lsquo&semi;&ast;Windows Server&ast;&rsquo&semi;&rcub;<&sol;p>&NewLine;<p>&dollar;Input &equals; ForEach &lpar;&dollar;computer in &dollar;computers&rpar;&lbrace;<&sol;p>&NewLine;<p>&dollar;comp &equals; &dollar;Computer&period;DNSHostName<&sol;p>&NewLine;<p>&dollar;dist &equals; &dollar;Computer&period;DistinguishedName<&sol;p>&NewLine;<p>if &lpar;Test-Connection -Computername &dollar;comp -count 2 -Quiet &rpar;<&sol;p>&NewLine;<p>&lbrace;<&sol;p>&NewLine;<p>Invoke-Command -ComputerName &dollar;comp -ScriptBlock &lbrace;Get-WmiObject win32&lowbar;service &vert; where &lbrace;&dollar;&lowbar;&period;StartName -notlike &ldquo&semi;&ast;LocalSystem&ast;&rdquo&semi; -and &dollar;&lowbar;&period;StartName -notlike &ldquo&semi;&ast;LocalService&ast;&rdquo&semi; -and &dollar;&lowbar;&period;StartName -notlike &ldquo&semi;&ast;NetworkService&ast;&rdquo&semi; -and &dollar;&lowbar;&period;StartName -notlike &ldquo&semi;&ast;System&ast;&rdquo&semi;&rcub; &vert; select DisplayName&comma;StartName&comma;State &rcub;&rcub;<&sol;p>&NewLine;<p>else&lbrace; Write-host &dollar;comp is down -foregroundColor red -BackGroundColor black<&sol;p>&NewLine;<p>&rcub;<&sol;p>&NewLine;<p>&rcub;<&sol;p>&NewLine;<p>&dollar;Output &equals; Read-Host &ldquo&semi;Enter File path and Name to save output to&rdquo&semi;<&sol;p>&NewLine;<p>Out-File -FilePath &dollar;Output -InputObject &dollar;Input -Encoding ascii<&sol;p>&NewLine;<p>Notepad &dollar;Output<&sol;p><&sol;blockquote><p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image-1&period;png"><br>&NewLine;<img title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image&lowbar;thumb-1&period;png" alt&equals;"image" width&equals;"760" height&equals;"251" border&equals;"0"><&sol;a><&sol;p><div> &NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2531 " id&equals;"quads-ad2531" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; <&sol;div><p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image-2&period;png"><img title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;website&sol;wp-content&sol;uploads&sol;2019&sol;08&sol;image&lowbar;thumb-2&period;png" alt&equals;"image" width&equals;"1028" height&equals;"340" border&equals;"0"><&sol;a><&sol;p><&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2530 " id&equals;"quads-ad2530" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;

moh10ly

View Comments

Recent Posts

Reset passwords for Active Directory Users

Reset and manage your Active Directory users' Passwords Active Directory is one of the most…

3 years ago

Finding Exchange Database hidden mailboxes. ​

Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…

3 years ago

Setting up ADConnect and PTA (Password auth through) servers agents behind proxy

If you're using a Proxy server in your firewall or in your network and have…

3 years ago

Get Report of Active Directory Locked Accounts and Machine they logged in from

Story:I got some clients  that have reported some of their users being locked out and…

3 years ago

Checking and Providing Full and SendAs delegate access on O365 Exchange Online

Delegate Permissions This is a code that I have wrote recently to check if an…

3 years ago

Retrieving attachments from Exchange mailbox using python

Story: I got a request from a client who constantly gets CVs and have to…

4 years ago

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298