<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Windows Stuff Archives - VirtJunkie</title>
	<atom:link href="/category/win/feed/" rel="self" type="application/rss+xml" />
	<link>/category/win/</link>
	<description>Virtualization, Automation, and anything else that might be on my mind</description>
	<lastBuildDate>Wed, 19 Jun 2013 02:30:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.5</generator>

<image>
	<url>/wp-content/uploads/2020/04/cropped-vj4-150x150.png</url>
	<title>Windows Stuff Archives - VirtJunkie</title>
	<link>/category/win/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</title>
		<link>/2013/06/18/473/</link>
					<comments>/2013/06/18/473/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Wed, 19 Jun 2013 02:30:55 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Windows Stuff]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=473</guid>

					<description><![CDATA[<p>This falls into the &#8220;Come on Microsoft&#8221; category. I have been writing a script that will gather a bunch of information from servers, and returns an object with the information.  Part of what I&#8217;m gathering is the servers that are set to auto start, and have their corresponding service stopped. While you can get a [&#8230;]</p>
<p>The post <a href="/2013/06/18/473/">Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This falls into the &#8220;Come on Microsoft&#8221; category.</p>
<p>I have been writing a script that will gather a bunch of information from servers, and returns an object with the information.  Part of what I&#8217;m gathering is the servers that are set to auto start, and have their corresponding service stopped.</p>
<p>While you can get a list of services that meet part of this criteria like this:</p>
<p><span id="more-473"></span></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-Service -ComputerName &quot;computername&quot; |
Where-Object { $_.status -eq &quot;Stopped&quot; } |
select-object DisplayName</pre><p></p>
<p>The obvious problem here is that this will not return services that are set to. You can run the following command to find the service name (not the human friendly name above) as well as the startup type using the command below</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-WmiObject win32_service |
where {$_.state -eq &quot;stopped&quot; -and $_.startmode -eq &quot;auto&quot;}</pre><p></p>
<p>Now, if only Microsoft allowed us get all 3 (Service Descriptive Name, Service Status, Autostart Status) in one command, that would be great!  Until they get around to it, you can use this command:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-WmiObject win32_service |
where {$_.state -eq &quot;stopped&quot; -and $_.startmode -eq &quot;auto&quot;} |
Get-Service |
select displayname</pre><p></p>
<p>The post <a href="/2013/06/18/473/">Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/06/18/473/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</title>
		<link>/2013/04/19/use-powershell-to-change-specific/</link>
					<comments>/2013/04/19/use-powershell-to-change-specific/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 19 Apr 2013 16:00:31 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Windows Stuff]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=419</guid>

					<description><![CDATA[<p>I encountered a challenge today that was fun to fix.  There&#8217;s an Organizational Unit in my AD setup that has historically been used to store disabled AD objects instead of deleting them. When an employee leaves the organization, our standard procedure  is as followed: Disable User Object Move to separate OU (IE AD://internal.msd/disabled/users) Update Description [&#8230;]</p>
<p>The post <a href="/2013/04/19/use-powershell-to-change-specific/">Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I encountered a challenge today that was fun to fix.  There&#8217;s an Organizational Unit in my AD setup that has historically been used to store disabled AD objects instead of deleting them.</p>
<p>When an employee leaves the organization, our standard procedure  is as followed:</p>
<ol>
<li><span style="line-height: 13px;">Disable User Object</span></li>
<li>Move to separate OU (IE AD://internal.msd/disabled/users)</li>
<li>Update Description field with something like: Disabled by [username] on [date]</li>
<li>Retain user object for x amount of days, then tombstone it.</li>
</ol>
<p>Best laid plans of mice and men&#8230; yada yada&#8230;</p>
<p><span id="more-419"></span></p>
<p>I was able to go through all of these user objects that didn&#8217;t get their description updated with the one liner below. I&#8217;ll explain this beginning with script line 3 below:</p>
<ul>
<li><span><span>(Line 3) Find all users in the OU: </span></span><span style="line-height: 19px;">&#8216;OU=Users,OU=Disabled,DC=internal,DC=msd&#8217; &#8211; customize this to your environment</span></li>
<li><span style="line-height: 19px;">(Line 4) Exclude objects where the description does not contain the word &#8220;disabled&#8221;.</span></li>
<li>(Lines 5-7) Loop through each object that remains and update the description with the same object&#8217;s last login date.</li>
</ul>
<p>FYI &#8211; this script requires the Quest ActiveRoles Powershell Toolkit (<a href="http://www.quest.com/powershell/activeroles-server.aspx">http://www.quest.com/powershell/activeroles-server.aspx</a>)</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">#This script requires Quest AD Tools
add-pssnapin Quest.ActiveRoles.ADManagement

#Everything below this is on one line
get-QADUser -searchroot 'OU=Users,OU=Disabled,DC=internal,DC=msd'
| Where-Object { $_.Description -notlike &amp;quot;*disabled*&amp;quot; }
| ForEach-Object { set-qaduser -identity
(get-qaduser $_.samaccountname) -description
(&amp;quot;Last Login: &amp;quot; + (get-qaduser $_.samaccountname).lastlogon})</pre><p></p>
<p>I&#8217;m sure there&#8217;s a more elegant way to handle this, but in 30 minutes I created this one liner, and updated <em>a lot</em> of user objects.</p>
<p>Cheers!</p>
<p>The post <a href="/2013/04/19/use-powershell-to-change-specific/">Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/04/19/use-powershell-to-change-specific/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
