Solved

GPO to deploy Web Folder

Posted on 2009-06-30
7
612 Views
Last Modified: 2012-05-07
Hi
We would like to deploy web folders using GPO to users in our domain so that they can access a SharePoint file system through Office applications.  UNC paths do not work for this purpose very well as folder structure can be missing ie we would like to use a GPO to deploy a "My Network Place" to http://test/document library/doclib1

We have a 2008 server on the domain to administer GP as it was suspected this would help

Urgent help greatly appreciated
0
Comment
Question by:jamesharold
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 74

Expert Comment

by:Glen Knight
ID: 24744272
If you have Windows 2008 you can use Group Policy Extensions to achieve this.
Have a look at: http://www.eggheadcafe.com/conversation.aspx?messageid=34099701&threadid=34092341
Someone trying to do a similar thing.
0
 

Author Comment

by:jamesharold
ID: 24746399
Hi dematzer

I have been here already.  Unfortunately the string does not provide an answer.  Having also surfed extensively, EE was my last resort.

Thanks
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 24746913
What OS are your clients running?
Do they have Client Side Extensions installed for Group Policy Extensions? http://technet.microsoft.com/en-us/library/cc731892(WS.10).aspx
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 

Author Comment

by:jamesharold
ID: 24747113
We run XP Pro and yes.  What seems to happen when following the uinstructions as suggested is that a shortcut will appear for the Internet Site and not a Web Folder.

When choosing the folder option during the GPO configuration it will only let you use a UNC path
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 24747388
Is using a script out of the question?
You could then create a shortcut in: %USERPROFILE%\NetHood

Or alternatively create your shortcut and put the lnk file on a network share then run the following in a loginscript: copy /y "\\server\servershare\shortcut.lnk" "%USERPROFILE%\NetHood\"
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 24747419
sorry ignore the .lnk if you create a netfolder shre I dont think it had it.
I just did this in an SBS2003 environment and it worked OK
0
 

Accepted Solution

by:
jamesharold earned 0 total points
ID: 24752751
We finally came up with this, used at login:

'Create Network Folder
'This is a fix to the original, which I found did not handle URLs
'longer than 44 characters.

Option Explicit

Sub CreateNetworkFolder(siteURL, siteName)

Dim iRes, jRes, MT, TT
Dim SH, newPath
Dim objFso, f, fs, g
Dim bString
Dim ltrIndex
Dim nameLength, urlLength, urlCutoff
Dim aFile

'ForWriting (2) is the attribute to be set when writing to a file.
Const ForWriting = 2

nameLength = Len(siteName)
urlLength = Len(siteURL)
'44 seems to be the length where we have to change a 00 to a 01.
urlCutoff = 44

Set objFso = CreateObject("Scripting.FileSystemObject")

If iRes = vbCancel Then
WScript.Quit
End If

Set SH = WScript.CreateObject("WScript.Shell")

'Create the folder under NetHood that will hold the target.lnk file
newPath = SH.SpecialFolders("NetHood") & "\" & siteName

If (objFso.FolderExists(newPath)) Then
WScript.Quit
End If

objFso.CreateFolder(newPath)

'We ceate a Desktop.ini file
Set fs = CreateObject("Scripting.FileSystemObject")
aFile = newPath & "\Desktop.ini"

Set f = fs.OpenTextFile( aFile, ForWriting, True )

'Write the data lines that will make this a folder shortcut.
f.WriteLine "[.ShellClassInfo]"
f.WriteLine "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}"
f.WriteLine "Flags=2"
f.WriteLine "ConfirmFileOp=0"
f.Close

'We make Desktop.ini a system-hidden file by assigning it attribute of 6
Set fs = CreateObject("Scripting.FileSystemObject")
Set g = fs.GetFile(newPath & "\Desktop.ini")
g.Attributes = 6

'We make the folder read-only by assigning it 1.
Set fs = CreateObject("Scripting.FileSystemObject")
Set g = fs.GetFolder(newPath)
g.Attributes = 1

'This is where we construct the target.lnk file byte by byte. Most of
'the lines are shown in 16 byte chunks,
'mostly because that is the way I saw it in the Debug utility I was
'using to inspect shortcut files.

'Line 1, 16 bytes
bString = Chr(&H4C) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H01) & Chr(&H14) & Chr(&H02) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&HC0) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'Line 2, 16 bytes
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H46) & Chr(&H81) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'Line 3, 16 bytes
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'Line 4., 16 bytes. 13th byte is significant.
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H01) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'Line 5. 13th byte is significant.
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'When I was analyzing the next byte of shortcuts I created, I found
'that it is set to various values,
'and I have no idea what they are referring to. In desperation I tried
'substituting some values.
'00 caused a crash of Explorer. FF seeems to work fine for all.
'If anyone can get back to me on what this byte is or why FF works,
'please contact me.
bString = bString & Chr(&HFF)

'This byte is 00 if the URL is 44 characters or less, 01 if greater.
If urlLength > urlCutoff Then
bString = bString & Chr(&H01)
Else
bString = bString & Chr(&H00)
End If

bString = bString & Chr(&H14) & Chr(&H00)

'Line 6, 16 bytes
bString = bString & Chr(&H1F) & Chr(&H50) & Chr(&HE0) & Chr(&H4F) & Chr(&HD0) & Chr(&H20) & Chr(&HEA) & Chr(&H3A) & Chr(&H69) & Chr(&H10) & Chr(&HA2) & Chr(&HD8) & Chr(&H08) & Chr(&H00) & Chr(&H2B) & Chr(&H30)

'Line 7, 16 bytes
bString = bString & Chr(&H30) & Chr(&H9D) & Chr(&H14) & Chr(&H00) & Chr(&H2E) & Chr(&H00) & Chr(&H00) & Chr(&HDF) & Chr(&HEA) & Chr(&HBD) & Chr(&H65) & Chr(&HC2) & Chr(&HD0) & Chr(&H11) & Chr(&HBC) & Chr(&HED)

'Line 8, 16 bytes
bString = bString & Chr(&H00) & Chr(&HA0) & Chr(&HC9) & Chr(&H0A) & Chr(&HB5) & Chr(&H0F) & Chr(&HA4)

'This byte is 00 if the URL is 44 characters or less, 01 if greater.
If urlLength > urlCutoff Then
bString = bString & Chr(&H01)
Else
bString = bString & Chr(&H00)
End If

bString = bString & Chr(&H4C) & Chr(&H50) & Chr(&H00) & Chr(&H01) & Chr(&H42) & Chr(&H57) & Chr(&H00) & Chr(&H00)

'Line 9, 16 bytes
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H10) & Chr(&H00)

'Line 10, 2 bytes
bString = bString & Chr(&H00) & Chr(&H00)

'The next byte represents the length of the site name.
bString = bString & Chr(nameLength)

'Take the site name, and write each letter, preceeded by a "00"
'character.

For ltrIndex = 1 to nameLength
bString = bString & Chr(&H00) & Mid(siteName, ltrIndex, 1)
Next

'Middle line, separates the Folder Name from the URL. 3 bytes.
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00)

'The next byte represents the length of the site URL.
bString = bString & Chr(urlLength)

'Take the site URL, and write each letter, preceeded by a "00"
'character.
For ltrIndex = 1 to urlLength
bString = bString & Chr(&H00) & Mid(siteURL, ltrIndex, 1)
Next

'Last line, 13 bytes
bString = bString & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&H00)

'Let's create the target.lnk file.
Set fs = CreateObject("Scripting.FileSystemObject")
aFile = newPath & "\target.lnk"
'aFile = newPath & "\vb.sss"
Set f = fs.OpenTextFile(aFile, ForWriting, True)
f.Write bString
f.Close

End Sub

CreateNetworkFolder "Your URL", "name"
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

OfficeMate Freezes on login or does not load after login credentials are input.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question