<?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>Yusuf Ozturk</title>
	<atom:link href="http://www.yusufozturk.info/feed" rel="self" type="application/rss+xml" />
	<link>http://www.yusufozturk.info</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 02 Mar 2010 09:43:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating New FTP User on Active Directory with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/creating-new-ftp-user-on-active-directory-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/creating-new-ftp-user-on-active-directory-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:43:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[create domain user powershell]]></category>
		<category><![CDATA[create ftp user powershell]]></category>
		<category><![CDATA[ftp user on active directory powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1977</guid>
		<description><![CDATA[Creates a new user on Active Directory and sets &#8220;Password never expires&#8221;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Function Add-FTPUser
&#123;
Param &#40;$FTPUsername, $FTPPassword&#41;
&#160;
    $ADDomain = &#91;System.DirectoryServices.ActiveDirectory.Domain&#93;::GetCurrentDomain&#40;&#41;
    $ADDomainName = $ADDomain.Name
    $ADServer = &#40;$ADDomain.InfrastructureRoleOwner.Name.Split&#40;&#34;.&#34;&#41;&#91;0&#93;&#41;
    $FQDN = &#34;DC=&#34; + $ADDomain.Name -Replace&#40;&#34;\.&#34;,&#34;,DC=&#34;&#41;
    $ADDomain = &#91;ADSI&#93; &#34;LDAP://$ADServer/$FQDN&#34;
    $CustomerOU = &#91;ADSI&#93; [...]]]></description>
			<content:encoded><![CDATA[<p>Creates a new user on Active Directory and sets &#8220;Password never expires&#8221;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">Function</span> Add<span style="color: pink;">-</span>FTPUser
<span style="color: #000000;">&#123;</span>
<span style="color: #0000FF;">Param</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$FTPUsername</span><span style="color: pink;">,</span> <span style="color: #800080;">$FTPPassword</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #800080;">$ADDomain</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>System.DirectoryServices.ActiveDirectory.Domain<span style="color: #000000;">&#93;</span>::GetCurrentDomain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADDomainName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ADDomain</span>.Name
    <span style="color: #800080;">$ADServer</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ADDomain</span>.InfrastructureRoleOwner.Name.Split<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$FQDN</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;DC=&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$ADDomain</span>.Name <span style="color: #FF0000;">-Replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\.&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;,DC=&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADDomain</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://$ADServer/$FQDN&quot;</span>
    <span style="color: #800080;">$CustomerOU</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://$CustomerOU,$FQDN&quot;</span>
    <span style="color: #800080;">$User</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://CN=$FTPUsername,$CustomerOU,$FQDN&quot;</span>
    <span style="color: #800080;">$PrincipalName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$FTPUsername</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;@&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$ADDomainName</span>
    <span style="color: #800080;">$AddADUser</span> <span style="color: pink;">=</span> <span style="color: #800080;">$CustomerOU</span>.Create<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;User&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;CN=$FTPUsername&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Description&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$FTPUsername&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;sAMAccountName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$FTPUsername&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;userPrincipalName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$PrincipalName&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;DisplayName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$FTPUsername&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetPassword<span style="color: #000000;">&#40;</span><span style="color: #800080;">$FTPPassword</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Psbase.Invokeset<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;AccountDisabled&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;False&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;userAccountControl&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;65536&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>I didn&#8217;t change Primary Group of my FTP user. Because I don&#8217;t need for ACL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/creating-new-ftp-user-on-active-directory-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating New IIS User on Active Directory with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/creating-new-iis-user-on-active-directory-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/creating-new-iis-user-on-active-directory-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:40:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[create domain user powershell]]></category>
		<category><![CDATA[create iis user powershell]]></category>
		<category><![CDATA[create new iis user on ad powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1975</guid>
		<description><![CDATA[Creates a new user on Active Directory, sets &#8220;Password never expires&#8221; and changes primary group of user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Function Add-IISUser
&#123;
Param &#40;$Username, $Password&#41;
&#160;
    $ADDomain = &#91;System.DirectoryServices.ActiveDirectory.Domain&#93;::GetCurrentDomain&#40;&#41;
    $ADDomainName = $ADDomain.Name
    $ADServer = &#40;$ADDomain.InfrastructureRoleOwner.Name.Split&#40;&#34;.&#34;&#41;&#91;0&#93;&#41;
    $FQDN = &#34;DC=&#34; + $ADDomain.Name -Replace&#40;&#34;\.&#34;,&#34;,DC=&#34;&#41;
    $ADDomain = &#91;ADSI&#93; &#34;LDAP://$ADServer/$FQDN&#34;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Creates a new user on Active Directory, sets &#8220;Password never expires&#8221; and changes primary group of user.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">Function</span> Add<span style="color: pink;">-</span>IISUser
<span style="color: #000000;">&#123;</span>
<span style="color: #0000FF;">Param</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Username</span><span style="color: pink;">,</span> <span style="color: #800080;">$Password</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #800080;">$ADDomain</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>System.DirectoryServices.ActiveDirectory.Domain<span style="color: #000000;">&#93;</span>::GetCurrentDomain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADDomainName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ADDomain</span>.Name
    <span style="color: #800080;">$ADServer</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ADDomain</span>.InfrastructureRoleOwner.Name.Split<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$FQDN</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;DC=&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$ADDomain</span>.Name <span style="color: #FF0000;">-Replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\.&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;,DC=&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADDomain</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://$ADServer/$FQDN&quot;</span>
    <span style="color: #800080;">$CustomerOU</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://$CustomerOU,$FQDN&quot;</span>
    <span style="color: #800080;">$User</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://CN=$Username,$CustomerOU,$FQDN&quot;</span>
    <span style="color: #800080;">$PrincipalName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$Username</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;@&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$ADDomainName</span>
    <span style="color: #800080;">$AddADUser</span> <span style="color: pink;">=</span> <span style="color: #800080;">$CustomerOU</span>.Create<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;User&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;CN=$Username&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Description&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$Username&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;sAMAccountName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$Username&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;userPrincipalName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$PrincipalName&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;DisplayName&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;$Username&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetPassword<span style="color: #000000;">&#40;</span><span style="color: #800080;">$Password</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Psbase.Invokeset<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;AccountDisabled&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;False&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;userAccountControl&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;65536&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$DomainNC</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://RootDSE&quot;</span><span style="color: #000000;">&#41;</span>.DefaultNamingContext
    <span style="color: #800080;">$DomainUsers</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://CN=Domain Users,CN=Users,$DomainNC&quot;</span>
    <span style="color: #800080;">$DomainUsers</span>.GetInfoEx<span style="color: #000000;">&#40;</span><span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$OldGroupToken</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DomainUsers</span>.Get<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$DomainGuests</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://CN=IIS_USERS,CN=Users,$DomainNC&quot;</span>
    <span style="color: #800080;">$DomainGuests</span>.GetInfoEx<span style="color: #000000;">&#40;</span><span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$NewGroupToken</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DomainGuests</span>.Get<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$DomainGuests</span>.Add<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">String</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$AddADUser</span>.AdsPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupId&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$NewGroupToken</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$AddADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$DomainUsers</span>.Remove<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">String</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$AddADUser</span>.AdsPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Our new Primary Group is IIS_USERS as you see. You can change that group name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/creating-new-iis-user-on-active-directory-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Active Directory Information with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/getting-active-directory-information-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/getting-active-directory-information-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:35:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[get ad fqdn powershell]]></category>
		<category><![CDATA[get ad info powershell]]></category>
		<category><![CDATA[get ad primary server name powershell]]></category>
		<category><![CDATA[get domain info powershell]]></category>
		<category><![CDATA[getting ad domain info powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1972</guid>
		<description><![CDATA[My script works on all Active Directory Infrastructures without any change on script.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Function Get-ADInfo
&#123;
    $ADDomain = &#91;System.DirectoryServices.ActiveDirectory.Domain&#93;::GetCurrentDomain&#40;&#41;
    $ADDomainName = $ADDomain.Name
    $Netbios = $ADDomain.Name.Split&#40;&#34;.&#34;&#41;&#91;0&#93;.ToUpper&#40;&#41;
    $ADServer = &#40;$ADDomain.InfrastructureRoleOwner.Name.Split&#40;&#34;.&#34;&#41;&#91;0&#93;&#41;
    $FQDN = &#34;DC=&#34; + $ADDomain.Name -Replace&#40;&#34;\.&#34;,&#34;,DC=&#34;&#41;
&#160;
    $Results = New-Object Psobject
  [...]]]></description>
			<content:encoded><![CDATA[<p>My script works on all Active Directory Infrastructures without any change on script.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">Function</span> Get<span style="color: pink;">-</span>ADInfo
<span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$ADDomain</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>System.DirectoryServices.ActiveDirectory.Domain<span style="color: #000000;">&#93;</span>::GetCurrentDomain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADDomainName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ADDomain</span>.Name
    <span style="color: #800080;">$Netbios</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ADDomain</span>.Name.Split<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$ADServer</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ADDomain</span>.InfrastructureRoleOwner.Name.Split<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #800080;">$FQDN</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;DC=&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$ADDomain</span>.Name <span style="color: #FF0000;">-Replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\.&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;,DC=&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #800080;">$Results</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Psobject
    <span style="color: #800080;">$Results</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty Domain <span style="color: #800080;">$ADDomainName</span>
    <span style="color: #800080;">$Results</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty FQDN <span style="color: #800080;">$FQDN</span>
    <span style="color: #800080;">$Results</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty Server <span style="color: #800080;">$ADServer</span>
    <span style="color: #800080;">$Results</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty Netbios <span style="color: #800080;">$Netbios</span>
    <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800080;">$Results</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Usage is pretty simple:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>ADInfo</pre></div></div>

<p>Thats all! :)</p>
<p><strong>Getting Netbios name:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>ADInfo<span style="color: #000000;">&#41;</span>.Netbios</pre></div></div>

<p><strong>Getting FQDN:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>ADInfo<span style="color: #000000;">&#41;</span>.FQDN</pre></div></div>

<p><strong>Getting Active Directory Domain Name:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>ADInfo<span style="color: #000000;">&#41;</span>.$ADDomainName</pre></div></div>

<p><strong>Getting Active Directory Primary Server Name:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>ADInfo<span style="color: #000000;">&#41;</span>.$ADServer</pre></div></div>

<p>You can use this in your all scripts. You no longer need any active directory information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/getting-active-directory-information-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Active Directory User with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/removing-active-directory-user-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/removing-active-directory-user-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:26:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[remove ad user]]></category>
		<category><![CDATA[removing ad user with powershell]]></category>
		<category><![CDATA[removing domain user with powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1970</guid>
		<description><![CDATA[It&#8217;s very easy to remove an Active Directory user with Powershell.

1
2
$CustomerOU = &#91;ADSI&#93; &#34;LDAP://$CustomerOU,$FQDN&#34;
$RemoveADUser = $CustomerOU.Delete&#40;&#34;User&#34;, &#34;CN=$Username&#34;&#41;

Again and again, please be sure about your LDAP path.
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very easy to remove an Active Directory user with Powershell.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$CustomerOU</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://$CustomerOU,$FQDN&quot;</span>
<span style="color: #800080;">$RemoveADUser</span> <span style="color: pink;">=</span> <span style="color: #800080;">$CustomerOU</span>.Delete<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;User&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;CN=$Username&quot;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>Again and again, please be sure about your LDAP path.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/removing-active-directory-user-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Active Directory User Password with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/changing-active-directory-user-password-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/changing-active-directory-user-password-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:23:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[change ad user password with powershell]]></category>
		<category><![CDATA[powershell ad user password]]></category>
		<category><![CDATA[powershell change domain user password]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1968</guid>
		<description><![CDATA[You see how easy to change ad user password with Powershell.

1
2
3
$ADUser = &#91;ADSI&#93; &#34;LDAP://CN=$Username,$CustomerOU,$FQDN&#34;
$ADUser.SetPassword&#40;$Password&#41;
$ADUser.SetInfo&#40;&#41;

Again, be careful to LDAP name. Have fun!
]]></description>
			<content:encoded><![CDATA[<p>You see how easy to change ad user password with Powershell.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$ADUser</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://CN=$Username,$CustomerOU,$FQDN&quot;</span>
<span style="color: #800080;">$ADUser</span>.SetPassword<span style="color: #000000;">&#40;</span><span style="color: #800080;">$Password</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$ADUser</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>Again, be careful to LDAP name. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/changing-active-directory-user-password-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Primary Groups of Active Directory Users with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/setting-primary-groups-of-active-directory-users-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/setting-primary-groups-of-active-directory-users-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:19:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[active directory users primary group]]></category>
		<category><![CDATA[ad user group]]></category>
		<category><![CDATA[powershell ad primary group setting]]></category>
		<category><![CDATA[setting primary group of ad users]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1965</guid>
		<description><![CDATA[As you know, changing Primary Group of Active Directory users is a difficult job for system administrators.
You need to set a new one, then assign that as a primary, after all you can remove old group.
But that&#8217;s easy if you know Powershell.

1
2
3
4
5
6
7
8
9
10
11
12
$User = &#91;ADSI&#93; &#34;LDAP://CN=$Username,$CustomerOU,$FQDN&#34;
$DomainNC = &#40;&#91;ADSI&#93;&#34;LDAP://RootDSE&#34;&#41;.DefaultNamingContext
$DomainUsers = &#91;ADSI&#93;&#34;LDAP://CN=Domain Users,CN=Users,$DomainNC&#34;
$DomainUsers.GetInfoEx&#40;@&#40;&#34;primaryGroupToken&#34;&#41;, 0&#41;
$OldGroupToken = $DomainUsers.Get&#40;&#34;primaryGroupToken&#34;&#41;
$DomainGuests = &#91;ADSI&#93;&#34;LDAP://CN=IIS_USERS,CN=Users,$DomainNC&#34;
$DomainGuests.GetInfoEx&#40;@&#40;&#34;primaryGroupToken&#34;&#41;, [...]]]></description>
			<content:encoded><![CDATA[<p>As you know, changing Primary Group of Active Directory users is a difficult job for system administrators.<br />
You need to set a new one, then assign that as a primary, after all you can remove old group.<br />
But that&#8217;s easy if you know Powershell.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$User</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://CN=$Username,$CustomerOU,$FQDN&quot;</span>
<span style="color: #800080;">$DomainNC</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://RootDSE&quot;</span><span style="color: #000000;">&#41;</span>.DefaultNamingContext
<span style="color: #800080;">$DomainUsers</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://CN=Domain Users,CN=Users,$DomainNC&quot;</span>
<span style="color: #800080;">$DomainUsers</span>.GetInfoEx<span style="color: #000000;">&#40;</span><span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$OldGroupToken</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DomainUsers</span>.Get<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$DomainGuests</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://CN=IIS_USERS,CN=Users,$DomainNC&quot;</span>
<span style="color: #800080;">$DomainGuests</span>.GetInfoEx<span style="color: #000000;">&#40;</span><span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$NewGroupToken</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DomainGuests</span>.Get<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupToken&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$DomainGuests</span>.Add<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">String</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$User</span>.AdsPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$User</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;primaryGroupId&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$NewGroupToken</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$User</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$DomainUsers</span>.Remove<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">String</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$User</span>.AdsPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>This script simply set IIS_USERS as a primary group of Active Directory users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/setting-primary-groups-of-active-directory-users-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting &#8220;Password never expires&#8221; for Active Directory Users with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/setting-password-never-expires-for-active-directory-users-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/setting-password-never-expires-for-active-directory-users-with-powershell.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:13:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[ad user password never expires]]></category>
		<category><![CDATA[password never expires]]></category>
		<category><![CDATA[powershell ad user password policy]]></category>
		<category><![CDATA[set password never expiress powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1963</guid>
		<description><![CDATA[You have to set &#8220;Password never expires&#8221; for some active directory users like IIS or SCVMM users. To do this with Powershell, we&#8217;ll simply use &#8220;userAccountControl&#8221; property with Powershell.

1
2
3
$User = &#91;ADSI&#93; &#34;LDAP://CN=$Username,$CustomerOU,$FQDN&#34;
$User.Put&#40;&#34;userAccountControl&#34;, &#34;65536&#34;&#41;
$User.SetInfo&#40;&#41;

65536 means &#8220;Password never expires&#8221;. Be careful with LDAP name. 
]]></description>
			<content:encoded><![CDATA[<p>You have to set &#8220;Password never expires&#8221; for some active directory users like IIS or SCVMM users. To do this with Powershell, we&#8217;ll simply use &#8220;userAccountControl&#8221; property with Powershell.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$User</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;LDAP://CN=$Username,$CustomerOU,$FQDN&quot;</span>
<span style="color: #800080;">$User</span>.Put<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;userAccountControl&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;65536&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$User</span>.SetInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>65536 means &#8220;Password never expires&#8221;. Be careful with LDAP name. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/setting-password-never-expires-for-active-directory-users-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking Active Directory User with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/checking-active-directory-user-with-powershell-2.html</link>
		<comments>http://www.yusufozturk.info/windows-server/checking-active-directory-user-with-powershell-2.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:06:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[check ad user if exist powershell]]></category>
		<category><![CDATA[check domain user account powershell]]></category>
		<category><![CDATA[checking ad user with powershell]]></category>
		<category><![CDATA[powershell check ad user]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1960</guid>
		<description><![CDATA[This is another way to check active directory user with Powershell. I made a function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Function Check-ADUser
&#123;
Param &#40;$Username&#41;
&#160;
    $ADRoot = &#91;ADSI&#93;''
    $ADSearch = New-Object System.DirectoryServices.DirectorySearcher&#40;$ADRoot&#41; 
    $SAMAccountName = &#34;$Username&#34;
    $ADSearch.Filter = &#34;(&#38;(objectClass=user)(sAMAccountName=$SAMAccountName))&#34;
    $Result = $ADSearch.FindAll&#40;&#41;
&#160;
    If&#40;$Result.Count -eq 0&#41;
 [...]]]></description>
			<content:encoded><![CDATA[<p>This is another way to check active directory user with Powershell. I made a function.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">Function</span> Check<span style="color: pink;">-</span>ADUser
<span style="color: #000000;">&#123;</span>
<span style="color: #0000FF;">Param</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Username</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #800080;">$ADRoot</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">''</span>
    <span style="color: #800080;">$ADSearch</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.DirectoryServices.DirectorySearcher<span style="color: #000000;">&#40;</span><span style="color: #800080;">$ADRoot</span><span style="color: #000000;">&#41;</span> 
    <span style="color: #800080;">$SAMAccountName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$Username&quot;</span>
    <span style="color: #800080;">$ADSearch</span>.<span style="color: #0000FF;">Filter</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;(&amp;(objectClass=user)(sAMAccountName=$SAMAccountName))&quot;</span>
    <span style="color: #800080;">$Result</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ADSearch</span>.FindAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0000FF;">If</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Result</span>.Count <span style="color: #FF0000;">-eq</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;No such user on the Server&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out-Null</span>
        <span style="color: #800080;">$Status</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;0&quot;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0000FF;">Else</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;User exist on the Server&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out-Null</span>
        <span style="color: #800080;">$Status</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;1&quot;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #800080;">$Results</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Psobject
    <span style="color: #800080;">$Results</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty Status <span style="color: #800080;">$Status</span>
    <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800080;">$Results</span>    
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><strong>Usage:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Check<span style="color: pink;">-</span>ADUser <span style="color: pink;">-</span>Username <span style="color: #800000;">&quot;yusufozturk&quot;</span></pre></div></div>

<p>You can use this function with Status property. It&#8217;s useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/checking-active-directory-user-with-powershell-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Quota Limit for IIS7.5 FTP Sites with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/creating-a-quota-limit-for-iis7-5-ftp-sites-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/creating-a-quota-limit-for-iis7-5-ftp-sites-with-powershell.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 13:40:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[iis7.5 ftp quota with powershell]]></category>
		<category><![CDATA[set dir quota of iis7.5 ftp]]></category>
		<category><![CDATA[setting dir quota in powershell]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1958</guid>
		<description><![CDATA[You should install Windows File Services to use DirQuota cmdlet in Powershell.

DirQuota Quota Add /Path:&#34;$LogDir&#34; /Limit:$FTPQuota

Usage of $FTPQuota is like &#8220;100mb&#8221;. You can use help to find out more.
]]></description>
			<content:encoded><![CDATA[<p>You should install Windows File Services to use DirQuota cmdlet in Powershell.</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">DirQuota Quota Add <span style="color: pink;">/</span>Path:<span style="color: #800000;">&quot;$LogDir&quot;</span> <span style="color: pink;">/</span>Limit:$FTPQuota</pre></div></div>

<p>Usage of $FTPQuota is like &#8220;100mb&#8221;. You can use help to find out more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/creating-a-quota-limit-for-iis7-5-ftp-sites-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Default Security Settings of FTP on IIS7.5 with Powershell</title>
		<link>http://www.yusufozturk.info/windows-server/clearing-default-security-settings-of-ftp-on-iis7-5-with-powershell.html</link>
		<comments>http://www.yusufozturk.info/windows-server/clearing-default-security-settings-of-ftp-on-iis7-5-with-powershell.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 13:30:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting & IIS7]]></category>
		<category><![CDATA[Windows Powershell]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[clear-webconfiguration]]></category>
		<category><![CDATA[iis7.5 ftp clear default security settings]]></category>
		<category><![CDATA[iis7.5 powershell clear ftp settings]]></category>

		<guid isPermaLink="false">http://www.yusufozturk.info/?p=1956</guid>
		<description><![CDATA[First you need to clear default security settings to create your own settings.

Clear-WebConfiguration -Filter /System.FtpServer/Security/Authorization -PSPath IIS: -Location &#34;Default FTP Site/$FTPUserDir&#34;

As I said in earlier posts, $FTPUserDir is the name of the FTP Virtual Site.
]]></description>
			<content:encoded><![CDATA[<p>First you need to clear default security settings to create your own settings.</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Clear<span style="color: pink;">-</span>WebConfiguration <span style="color: pink;">-</span><span style="color: #0000FF;">Filter</span> <span style="color: pink;">/</span>System.FtpServer<span style="color: pink;">/</span>Security<span style="color: pink;">/</span>Authorization <span style="color: pink;">-</span>PSPath IIS: <span style="color: pink;">-</span>Location <span style="color: #800000;">&quot;Default FTP Site/$FTPUserDir&quot;</span></pre></div></div>

<p>As I said in earlier posts, $FTPUserDir is the name of the FTP Virtual Site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yusufozturk.info/windows-server/clearing-default-security-settings-of-ftp-on-iis7-5-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
