Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Policy Conundrum

Status
Not open for further replies.

Roadki11

MIS
Mar 23, 2005
1,097
US
I have Windows 2003 Standard server running Terminal Server in Application Mode. I have a hand full of users in an OU with a GP pretty well locked down for this server. I have a URL I need to access by passing a system variable with the URL, this URL is going to an in house server. This is an example of what I need to do, The problem I have is its not picking up the username variable. If I take the user out of the OU with the locked down GP and connect to the same server that link works fine. So I know my problem is in the GP somewhere I just can’t figure out where. Now if I change the URL to this, it works fine. So I think to myself maybe its because I restricted access to the command shell(cmd.exe), but nope that isn’t the problem either. I opened access to the command shell and if I do “echo %username%” it replies with the username, but the URL still will not work. Any ideas would be greatly appreciated.

thanks
 
are you using the IE address lookup to parse the URL with the %var% in? Or constructing the var in a script and parsing the newly anylised URL, with resolved variable, then passing that to IE?

Neil J Cotton
njc Information Systems
Systems Consultant
 
No i am not doing anything fancy here. Its just an IE shortcut i created with the %username% system variable tacked on the end of the URL, which should pickup the logged on username. Something in my GP is stopping it from resolving the %username% variable into the actual username.
 
The only thing I can guess is that it is resolving this server side, do you have an actual environment variable in the Windows Environment Variable that is populated by a script, otherwise, Im not sure how when the shortcut is created this would be populated. My guess, to test this, would be to create a static EnvVar on the AD server called Username, and give that a value of a valid URL extention, your MikeBarnes or whatever, then create your Shortcut with the http:\\........blah.blah\%username%

deploy the new policy, and see if the shortcut is created with MikeBarnes on the client, that all I can guess, if not, and the policy is resolving the var clientside, and the var is populated in WinEnvVars, then let us know..

all i can suggest for now.

Hope this Helps

Neil J Cotton
njc Information Systems
Systems Consultant
 
I would alter the web page to look for the user name and not rely on the variable in the URL string.

somehting like:

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Set WSHNetwork = CreateObject("WScript.Network")
userstring = WSHNetwork.UserName
%>
<HTML>
<BODY>
<% Response.Write userstring %>
</BODY>
</HTML>



I hope you find this post helpful.

Regards,

Mark
 
Thanks for all the input, the vbscript below is what i ended up doing to accomplish what i needed. it will grap the logged on username and launch IE with the specified URL and attach the username to the end of it. works good.

RoadKi11


Code:
Dim WSHShell, WSHNetwork, UserString, oIE

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")

'Get user name
UserString = WSHNetwork.UserName

'Launch the URL with username attached at end
Set oIE = WScript.CreateObject("InternetExplorer.Application") 
oIE.Visible = True 
oIE.Navigate("[URL unfurl="true"]http://10.100.1.200/blah/2005/blahblah.html?"[/URL] + UserString) 

'Clean up memory used
set WSHNetwork = Nothing
set WSHShell = Nothing
set UserString = Nothing
Set oIE = Nothing

'Quit the Script
wscript.quit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top