<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Que Nguyen's Microsoft techology blog : {Scripting}</title><link>http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx</link><description>Tags: {Scripting}</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Hyper-V Scripting</title><link>http://blogs.technet.com/quenguyen/archive/2009/10/23/hyper-v-scripting.aspx</link><pubDate>Fri, 23 Oct 2009 08:18:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3288687</guid><dc:creator>quenguyen</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/quenguyen/comments/3288687.aspx</comments><wfw:commentRss>http://blogs.technet.com/quenguyen/commentrss.aspx?PostID=3288687</wfw:commentRss><description>* Dung K Hoang (HP USA) blog: http://dungkhoang.spaces.live.com/default.aspx * Hyper-V remote management configuration: http://code.msdn.microsoft.com/HVRemote...(&lt;a href="http://blogs.technet.com/quenguyen/archive/2009/10/23/hyper-v-scripting.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3288687" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Virtualization_7D00_/default.aspx">{Virtualization}</category><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx">{Scripting}</category></item><item><title>ISA Server logging</title><link>http://blogs.technet.com/quenguyen/archive/2008/12/22/isa-server-logging.aspx</link><pubDate>Mon, 22 Dec 2008 10:51:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3172042</guid><dc:creator>quenguyen</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/quenguyen/comments/3172042.aspx</comments><wfw:commentRss>http://blogs.technet.com/quenguyen/commentrss.aspx?PostID=3172042</wfw:commentRss><description>In order to query the log, in addtion to the builtin query viewer of ISA, you can install SQL client tools, then use SQL Analyzer to connect to ISA-SERVER\MSFW (replace ISA-SERVER with your actual server name) and query the log. See the example here ....(&lt;a href="http://blogs.technet.com/quenguyen/archive/2008/12/22/isa-server-logging.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3172042" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_ISA+Server_7D00_/default.aspx">{ISA Server}</category><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx">{Scripting}</category></item><item><title>Programmatically change phone numbers in Outlook</title><link>http://blogs.technet.com/quenguyen/archive/2008/10/21/programmatically-change-landline-phone-numbers-in-outlook.aspx</link><pubDate>Tue, 21 Oct 2008 13:19:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3139665</guid><dc:creator>quenguyen</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/quenguyen/comments/3139665.aspx</comments><wfw:commentRss>http://blogs.technet.com/quenguyen/commentrss.aspx?PostID=3139665</wfw:commentRss><description>First of all, you need to allow Macro execution by going to Tools/Marcro/Security, then restart Outlook Press Alt-F11 to open the Macro window. Below is the code skeleton for you to start with. Sub Outlook_Contact_Change() Dim folder As Outlook.folder...(&lt;a href="http://blogs.technet.com/quenguyen/archive/2008/10/21/programmatically-change-landline-phone-numbers-in-outlook.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3139665" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx">{Scripting}</category></item><item><title>Scripting - Sample Users/Group creation in AD</title><link>http://blogs.technet.com/quenguyen/archive/2008/10/16/scripting-sample-users-group-creation-in-ad.aspx</link><pubDate>Thu, 16 Oct 2008 14:39:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3137207</guid><dc:creator>quenguyen</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/quenguyen/comments/3137207.aspx</comments><wfw:commentRss>http://blogs.technet.com/quenguyen/commentrss.aspx?PostID=3137207</wfw:commentRss><description>&lt;DIV class=bvMsg id=msgcns!3D017455E3A4C295!203&gt;
&lt;DIV&gt;Set oRoot = GetObject("&lt;A&gt;&lt;FONT color=#0066a7&gt;LDAP://rootDSE&lt;/FONT&gt;&lt;/A&gt;")&lt;BR&gt;Set oDomain = GetObject("LDAP://" &amp;amp; oRoot.Get("defaultNamingContext"))&lt;/DIV&gt;
&lt;DIV&gt;Set oOU=oDomain.Create("organizationalUnit", "ou=My Corp Users")&lt;BR&gt;oOU.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR&gt;Set oUser = oOU.Create("User", "cn=Director One")&lt;BR&gt;oUser.Put "sAMAccountName", "director1"&lt;BR&gt;oUser.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;oUser.givenName="Director One"&lt;BR&gt;oUser.displayName="Director One"&lt;BR&gt;oUser.title="Managing Director"&lt;BR&gt;oUser.department="Director Dept"&lt;BR&gt;oUser.mail="&lt;A href="mailto:director1@mycompany.com.vn"&gt;&lt;FONT color=#0066a7&gt;director1@mycompany.com.vn&lt;/FONT&gt;&lt;/A&gt;"&lt;BR&gt;oUser.employeeID=789&lt;/DIV&gt;
&lt;DIV&gt;SetCommonProps(oUser)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Set oUser = oOU.Create("User", "cn=Manager One")&lt;BR&gt;oUser.Put "sAMAccountName", "manager1"&lt;BR&gt;oUser.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;oUser.givenName="Manager One"&lt;BR&gt;oUser.displayName="Manager One"&lt;BR&gt;oUser.title="Sales Manager"&lt;BR&gt;oUser.department="Sales &amp;amp; Marketing Dept"&lt;BR&gt;oUser.mail="&lt;A href="mailto:manager1@mycompany.com.vn"&gt;&lt;FONT color=#0066a7&gt;manager1@mycompany.com.vn&lt;/FONT&gt;&lt;/A&gt;"&lt;BR&gt;oUser.employeeID=678&lt;BR&gt;oUser.manager="CN=Director One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;/DIV&gt;
&lt;DIV&gt;SetCommonProps(oUser)&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR&gt;Set oUser = oOU.Create("User", "cn=Staff One")&lt;BR&gt;oUser.Put "sAMAccountName", "staff1"&lt;BR&gt;oUser.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;oUser.givenName="Staff One"&lt;BR&gt;oUser.displayName="Staff One"&lt;BR&gt;oUser.title="Sales Executive"&lt;BR&gt;oUser.department="Sales &amp;amp; Marketing Dept"&lt;BR&gt;oUser.mail="&lt;A href="mailto:staff1@mycompany.com.vn"&gt;&lt;FONT color=#0066a7&gt;staff1@mycompany.com.vn&lt;/FONT&gt;&lt;/A&gt;"&lt;BR&gt;oUser.employeeID=123&lt;BR&gt;oUser.manager="CN=Manager One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;/DIV&gt;
&lt;DIV&gt;SetCommonProps(oUser)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Set oUser = oOU.Create("User", "cn=Staff Two")&lt;BR&gt;oUser.Put "sAMAccountName", "staff2"&lt;BR&gt;oUser.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;oUser.givenName="Staff Two"&lt;BR&gt;oUser.displayName="Staff Two"&lt;BR&gt;oUser.title="Cashier"&lt;BR&gt;oUser.department="Sales &amp;amp; Marketing Dept"&lt;BR&gt;oUser.mail="&lt;A href="mailto:staff2@mycompany.com.vn"&gt;&lt;FONT color=#0066a7&gt;staff2@mycompany.com.vn&lt;/FONT&gt;&lt;/A&gt;"&lt;BR&gt;oUser.employeeID=234&lt;BR&gt;oUser.manager="CN=Manager One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;/DIV&gt;
&lt;DIV&gt;SetCommonProps(oUser)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Set oUser = GetObject("&lt;A&gt;&lt;FONT color=#0066a7&gt;LDAP://CN=Administrator,CN=Users,DC=mycompany,DC=com,DC=vn&lt;/FONT&gt;&lt;/A&gt;")&lt;BR&gt;oUser.givenName="Administrator"&lt;BR&gt;oUser.displayName="Administrator"&lt;BR&gt;oUser.title="System Admin"&lt;BR&gt;oUser.department="Director Dept"&lt;BR&gt;oUser.mail="&lt;A href="mailto:administrator@mycompany.com.vn"&gt;&lt;FONT color=#0066a7&gt;administrator@mycompany.com.vn&lt;/FONT&gt;&lt;/A&gt;"&lt;BR&gt;oUser.employeeID=012&lt;BR&gt;oUser.manager="CN=Director One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;BR&gt;oUser.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;SetCommonProps(oUser)&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR&gt;Set oGroup = oOU.Create("Group", "cn=Directors") 'Global group creation&lt;BR&gt;oGroup.Put "sAMAccountName", "Directors"&lt;BR&gt;oGroup.SetInfo&lt;BR&gt;oGroup.member="CN=Director One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;BR&gt;oGroup.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Set oGroup = oOU.Create("Group", "cn=Chief Accountants") &lt;BR&gt;oGroup.Put "sAMAccountName", "ChiefAccountants"&lt;BR&gt;oGroup.SetInfo&lt;BR&gt;oGroup.member="CN=Manager One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;BR&gt;oGroup.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Set oGroup = oOU.Create("Group", "cn=Accountants") 'Global group creation&lt;BR&gt;oGroup.Put "sAMAccountName", "Accountants"&lt;BR&gt;oGroup.SetInfo&lt;BR&gt;oGroup.member="CN=Staff One,OU=My Corp Users,DC=mycompany,DC=com,DC=vn"&lt;BR&gt;oGroup.SetInfo&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR&gt;Wscript.Echo "Users/Groups Creation Successul!"&lt;/DIV&gt;
&lt;DIV&gt;sub SetCommonProps(oUser)&lt;BR&gt;&amp;nbsp; oUser.SetPassword "&lt;FONT color=#0066a7&gt;P@ssw0rd&lt;/FONT&gt;"&lt;BR&gt;&amp;nbsp; oUser.AccountDisabled = False&lt;BR&gt;&amp;nbsp; oUser.company="My Company"&lt;BR&gt;&amp;nbsp; oUser.streetAddress="123 XYZ Street"&lt;BR&gt;&amp;nbsp; oUser.l="Hanoi"&lt;BR&gt;&amp;nbsp; oUser.c="VN"&lt;BR&gt;&amp;nbsp; oUser.telephoneNumber="+84-4-123-45678"&lt;BR&gt;&amp;nbsp; oUser.mobile="+84-9-1234-5678"&lt;BR&gt;&amp;nbsp; oUser.userAccountControl=66080 '0x10220=PASSWD_NOTREQD|NORMAL_ACCOUNT|DONT_EXPIRE_PASSWD)&lt;BR&gt;&amp;nbsp; oUser.SetInfo&lt;BR&gt;end sub&lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3137207" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx">{Scripting}</category></item><item><title>Windows Server scripting - first steps</title><link>http://blogs.technet.com/quenguyen/archive/2008/10/16/windows-2008-scripting-first-steps.aspx</link><pubDate>Thu, 16 Oct 2008 14:37:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3137206</guid><dc:creator>quenguyen</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/quenguyen/comments/3137206.aspx</comments><wfw:commentRss>http://blogs.technet.com/quenguyen/commentrss.aspx?PostID=3137206</wfw:commentRss><description>&lt;DIV class=bvMsg id=msgcns!3D017455E3A4C295!202&gt;
&lt;DIV&gt;************ Server machines &lt;EM&gt;&lt;SMALL&gt;&amp;lt;&amp;lt; note the number 1 at the end of netsh command, which is for the metric of the 192.168.1.10 gateway &amp;gt;&amp;gt;&lt;/SMALL&gt;&lt;/EM&gt;&lt;BR&gt;netsh interface ip set address name="Local Area Connection" static 192.168.1.1 255.255.255.0 192.168.1.10 1&lt;BR&gt;netsh interface ip set dns&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Local Area Connection" static 192.168.1.1 primary&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;netdom renamecomputer %COMPUTERNAME% /NewName HAN-SRV-01 /ReBoot:5 
&lt;DIV&gt;netdom join %COMPUTERNAME% /domain:MYCOMPANY /ReBoot:5&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;************ Domain controllers for new domains&lt;BR&gt;UNATTEND.TXT&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR&gt;[DCInstall]&lt;BR&gt;DNSOnNetwork=No&lt;BR&gt;DomainLevel=3&lt;BR&gt;DomainNetBiosName=MYCOMPANY&lt;BR&gt;ForestLevel=3&lt;BR&gt;NewDomain=Forest&lt;BR&gt;NewDomainDNSName=mycompany.com.vn&lt;BR&gt;RebootOnCompletion=Yes&lt;BR&gt;ReplicaOrNewDomain=Domain&lt;BR&gt;&lt;FONT color=#0066a7&gt;SafeModeAdminPassword=P@ssw0rd&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=#0066a7&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;dcpromo /unattend:unattend.txt&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;************ Additional domain controllers&lt;/DIV&gt;
&lt;DIV&gt;[DCInstall]&lt;BR&gt;UserName=Administrator&lt;BR&gt;&lt;FONT color=#0066a7&gt;Password=P@ssw0rd&lt;/FONT&gt;&lt;BR&gt;UserDomain=mycompany.com.vn&lt;BR&gt;DatabasePath=c:\windows\ntds&lt;BR&gt;LogPath=c:\windows\ntds&lt;BR&gt;SysVolPath=c:\windows\sysvol&lt;BR&gt;&lt;FONT color=#0066a7&gt;SafeModeAdminPassword=P@ssw0rd&lt;/FONT&gt;&lt;BR&gt;ReplicaOrNewDomain=Replica&lt;BR&gt;ReplicaDomainDNSName=mycompany.com.vn&lt;BR&gt;ReplicationSourceDC=han-srv-01.mycompany.com.vn&lt;BR&gt;InstallDNS=yes&lt;/DIV&gt;
&lt;DIV&gt;ConfirmGC=yes&lt;/DIV&gt;
&lt;DIV&gt;RebootOnCompletion=yes&lt;BR&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;*********** additional RODC on a Server Core&lt;/DIV&gt;
&lt;DIV&gt;; DCPROMO unattend file, automatically generated by dcpromo, by clicking the Export button at the end of the dcpromo wizard on a previous additional domain controller&lt;BR&gt;; Usage: ;&amp;nbsp;&amp;nbsp; dcpromo.exe /unattend:C:\RODC-unattend.txt&lt;BR&gt;&lt;FONT color=#00b0f0&gt;; You may need to fill in password fields prior to using the unattend file. ; If you leave the values for "&lt;FONT color=#ff0000&gt;Password&lt;/FONT&gt;" and/or "DNSDelegationPassword" as "*", then you will be asked for credentials at runtime. Please use the domain admin, not the local admin of the Server Core&lt;/FONT&gt;&lt;BR&gt;[DCInstall]&lt;BR&gt;; Read-Only Replica DC promotion&lt;BR&gt;ReplicaOrNewDomain=ReadOnlyReplica&lt;BR&gt;ReplicaDomainDNSName=mycompany.com.vn&lt;BR&gt;DelegatedAdmin="Administrator"&lt;BR&gt;SiteName=Default-First-Site-Name&lt;BR&gt;InstallDNS=Yes&lt;BR&gt;ConfirmGc=Yes&lt;BR&gt;CreateDNSDelegation=No&lt;BR&gt;UserDomain=mycompany.com.vn&lt;BR&gt;UserName=mycompany\administrator&lt;BR&gt;Password=*&lt;BR&gt;DatabasePath="C:\Windows\NTDS"&lt;BR&gt;LogPath="C:\Windows\NTDS"&lt;BR&gt;SYSVOLPath="C:\Windows\SYSVOL"&lt;BR&gt;; Set &lt;FONT color=#c0504d&gt;SafeModeAdminPassword&lt;/FONT&gt; to the correct value prior to using the unattend file&lt;BR&gt;&lt;FONT color=#0066a7&gt;SafeModeAdminPassword=P@ssw0rd&lt;/FONT&gt;&lt;BR&gt;; Run-time flags (optional)&lt;BR&gt;; CriticalReplicationOnly=Yes&lt;BR&gt;; RebootOnCompletion=Yes&lt;BR&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;************ Client machines&lt;BR&gt;netsh interface ip set address name="Local Area Connection" dhcp&lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3137206" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/quenguyen/archive/tags/_7B00_Scripting_7D00_/default.aspx">{Scripting}</category></item></channel></rss>