<?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>Jephens Tech. &#187; group membership</title>
	<atom:link href="http://www.jephens.com/tag/group-membership/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jephens.com</link>
	<description>Keeping Computers Happy Since 1997</description>
	<lastBuildDate>Tue, 22 Nov 2011 04:33:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Adding a Group Membership Based Shortcut to a Windows Desktop Upon Login</title>
		<link>http://www.jephens.com/2008/11/21/adding-a-group-membership-based-shortcut-to-a-windows-desktop-upon-login/</link>
		<comments>http://www.jephens.com/2008/11/21/adding-a-group-membership-based-shortcut-to-a-windows-desktop-upon-login/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 07:16:13 +0000</pubDate>
		<dc:creator>Jeff Knapp</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[desktop shortcut]]></category>
		<category><![CDATA[group membership]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://www.jephens.com/?p=70</guid>
		<description><![CDATA[(That's a wordy title, isn't it?) Had an issue with a client who needed to drop a shortcut to a Remote Desktop connection on certain desktops based upon their membership in a group. A little vbscripting, and we got it done. It's pretty simple. (You can cut and paste the script below. Change the variables [...]]]></description>
			<content:encoded><![CDATA[<p>(That's a wordy title, isn't it?)</p>
<p>Had an issue with a client who needed to drop a shortcut to a Remote Desktop connection on certain desktops based upon their membership in a group.</p>
<p>A little vbscripting, and we got it done. It's pretty simple. (You can cut and paste the script below. Change the variables to suit your environment. Word wrapping on the screen shouldn't carry over to your editing tool of choice -- mine is <a href="http://www.textpad.com" target="_blank">TextPad</a>.)</p>
<div class="code" style="margin:6px; margin-top:5px; margin-bottom: 2em;">Option Explicit<br />
'initialize our variables</p>
<p>Dim objUser, CurrentUser<br />
Dim strGroup<br />
Dim wShell<br />
Dim strDesktop, objFSO<br />
Dim link, GroupName</p>
<p>' Init our objects<br />
Set wShell = CreateObject("WScript.Shell")<br />
Set objFSO = CreateObject("Scripting.FileSystemObject")</p>
<p>Set objUser = CreateObject("ADSystemInfo")<br />
Set CurrentUser = GetObject("LDAP://" &amp; objUser.UserName)</p>
<p>'This is the magic... our group membership<br />
strGroup = LCase(Join(CurrentUser.MemberOf))</p>
<p>' logic testing<br />
If InStr(strGroup, lcase(GroupName)) Then</p>
<p>' get the desktop folder path. this works for all locations<br />
' redirected folders, etc.</p>
<p>strDesktop = WShell.SpecialFolders("Desktop")</p>
<p>' now we create our Shortcut object, and give it a name<br />
Set link = wShell.CreateShortcut(strDesktop &amp; "\Connect to TermServer.lnk")</p>
<p>' set the location where you store the file on the server<br />
link.TargetPath = "\\fileserver\path\server.rdp"</p>
<p>' and we have to save it to make it stick.<br />
link.Save</p>
<p>End If</p>
<p>WScript.Quit</p></div>
<p>Easy peasy.</p>
<p>So then, I add the script to a domain level Group Policy object I have called, logically enough, "Login Scripts" and it runs on each login, making sure our little icon is where it belongs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jephens.com/2008/11/21/adding-a-group-membership-based-shortcut-to-a-windows-desktop-upon-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

