Tech Blog

Random Tech Commentary & Solutions By Mark D. MacLachlan

The iPad Saga Part 2

In the interest of fairness I feel it important to document whatever I discover that was contrary to my initial findings.  To that end I wish to point out that this morning I learned how to move icons from one screen to another.  You have to start to drag the icon and then stop when it is half off the screen.  The next screen will appear and you can release the icon.  I sitll have the same complaint about the snap to grid feature.  Haven’t found a way to turn that off yet.

In the area of usefullness, I was able to download and successfully test a free RDP client.  That could prove somewhat useful in the future.

My coworker Camille was testing Kaseya in Safari.  Kaseya uses ActiveX controls, so yet another work program that isn’t fully supported on the device.  We use Kaseya mostly to be able to remote control client machines that have our support agent on them.  This agent uses VNC which is freely available for PC.  For the honor of owning an iPad, you can pay $9.95 for the iPad VNC Client.

Have to see if work will pay for that before I try downloading it.  I use LogMeIn for my home network access, so I would never use VNC for anything other than work.

After further testing it was also determined that I can access ConnectWise via the crappy web version.  This isn’t an iPad issue, the web interface used to be great until the last update when CW broke it with a redesign.  It is equally crappy on the iPad as it is on a PC.

No responses yet

The iPad Saga

OK, so my boss got me an iPad.  I fully admit that although I wanted to approach it with an open mind, I have many preconceived prejudices against it.  Still, I took this as a technical challenge and was hopeful I would have it running Android OS this evening.  Here is what I found.

1. If your iPad is running iOS 4.2.1 then forget about getting root access.  All the jailbreak utilities do nothing for this version because Apple doesn’t want people to actually be able to use their devices any way that Steve Jobs didn’t envision.  Bastards!  Hoping this will change soon but dependent on industrious hackers.

2. The device requires you to slow down your main PC by installing the crappy iTunes software along with f’ing Bonjour service and who know what else.  Bite me Steve, my Droids just needed USB driver you bastard.

3. The on screen keyboard sucks.  The characters on the keys always show as uppercase and you can’t long press on keys to get alternate characters.  A search in the iTunes store didn’t show even a paid version I could use to replace it.

4. The iTunes store sucks.  The ability to search seems very limited though perhaps this is a limitation of mine for not knowing how to exclude things.  For example the above search for a keyboard replacement yielded lots of virtual piano keyboards.

5. In comparison to the Android Market, there are practically no free apps.  The Android community is much more giving in this regard and I think a lot of that has to do with dealing with the iNazis who police the apps allowed on the iTunes store.

6. I wanted to get our main application called ConnectWise running on the device, but the application isn’t in the iTunes Store, presumably because I have an iPad rather than iPhone.  The web version of the application doesn’t run well under Safari.  Tried to download FireFox, nope.  Safari won’t let you.  BASTARDS!!!

7. OK, I could add my corporate email onto the thing, but then I have to deal with corporate security.  It is my device, so I don’t want to deal with that.  One less piece of functionality that I might actually have used.

So what DOES it do? Well there are a few things I found it can do well.  Checking FaceBook is great.  The screens auto zoom in and it is rather nice from a video perspective.  Twitter app looks great on it too.  So I guess what I have here is a nice social media appliance.  My home email is on it just fine, but browsing email is really difficult.  You can’t select emails for deletion easily like you can in Outlook or on an Android.  When in portrait mode the list of emails is a pull down.  All this screen real estate and I can’t dock that?

Like the mouse for Macs, Apple was only able to afford a single button on the iPad. Give me a break.  Are the iUsers so stupid they can only handle one button?  The button isn’t context sensitive either!  I guess there is something to be said for consistency.  Push the button and always go to the home screen.

Plug you iPad into your PC using the provided USB cable and guess what, IT WON”T CHARGE IT!!!  That’s right, you can sink all the damned music you want all day but we can’t charge off that cable unless you plug it into the wall.  Oh the expletives I want to shout, but my kid is on FaceBook now and is probably going to read this.

The idea of doing any real work with it is a pipe dream.  Don’t fool yourself into thinking this is a replacement for a laptop or anything that can seriously replace a good quality cell phone.  This is a toy, something to take with you to BarStucks to read an e-book (another thing it does very nicely), quickly check your email and watch a You-Tube video or two.  Your web browsing will be a bit challenged since a large percentage of web sites use Flash and iDevices don’t support that.

One last complaint, you can’t set icons on the page anywhere, they snap to a grid and can’t be moved between pages.  Thank you Apple, having a device has fully confirmed all my thoughts about your company philosophy and products.  They are inflexible, uncustomizable really expensive toys.

In fairness, my complaint about corporate email wouldn’t change even if it was running Android.  But on the up side there is an Android app I could run for ConnectWise.

I know I have shared my frustration and negative outlook on this so for the record I want to acknowledge that is was an expensive gift and my boss knew I’d have a mixed reaction to it and I AM grateful for the opportunity to learn about it.  I’ll also keep my eye out for when I can dump an Android OS on it and will follow up with a review of that process.

No responses yet

Trouble with RDP on Windows 7 to Windows 2008

This one was driving me crazy, I could connect to my SBS 2008 server from a 2003 server via RDP but not from a Windows 7 workstation.  The error was related to credentials:
“The credentials that were used to connect to <servername> did not work.  Please enter new credentials.”
I want to thank the SBS Diva Susan Bradley for pointing me to a blog entry that offered the solution. 
From within MSTSC save a connection to disk and then edit the RDP file in notepad.  Add the following code as the first line in the file:
          enablecredsspsupport:i:0
Save the file and open it with MSTSC.  You should now be able to log in.
No responses yet

Upgrading Windows 7 RC to RTM With Downgrade

When I installed the RC version of Windows 7 I tested out the Ultimate Edition.  Now that the product has been fully released, I needed to upgrade to the final code.  My company is licensed for Enterprise Edition though and the installation would not let you upgrade from RC to a down level edition.  Furthermore MS doesn’t allow you to perform an upgrade even within the same edition.

Not wanting to reinstall all of my applications, I had to find a solution.

Upgrading from beta or RC code to the final code is an easy fix.  Copy the DVD files to your hard drive.  Open the Sources folder.  Modify the CVERSION.INI file with notepad.  The MinClient value needs to be equal to the version number you have already installed.  So for me to upgrade from the RC I changed that file to the following:

[HostBuild]
MinClient=7100.0
MinServer=7100.0

OK, that will let you do an upgrade from an RC to the gold code, but the install will fail letting you know that you can’t upgrade from Ultimate to Enterprise. Luckily the fix is a simple one.  Open up regedit.  Navigate to the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion

Change the values of EditionID and ProductName to reflect the version you want to install.

So for me I changed EditionID from Ultimate to Enterprise and I changed ProductName from Windows 7 Ultimate to Windows 7 Enterprise.

After making those changes the installation proceeded without an issue.

No responses yet

Windows Tips, Tricks And Freeware

A few months back I discoverd DropBox. What an awesome concept this is. You can setup a free account and after installing the software on all the PCs you have you are able to drop files into a a “dropbox folder” and it will sync over the Internet to all of your PCs. In the event you just want to access your content and not install the software on a specific PC you can do so via the web login. You get 2GB of free space, additional space can be purchased. I highly recommend this free service. Sign up today with the following link.

https://www.dropbox.com/referrals/NTI3MDU2NzA5

Check out my complete list of Windows Tips, Tricks and Freeware on my DropBox Public Folder:
http://dl.dropbox.com/u/2705670/WindowsTipsAndTricksAndFreeware.rtf

In the interest of giving credit where it is due, I want to thank Tekzilla from Revision3.com for many of links to freeware utilities in my document. If you don’t watch Tekzilla, you should.

No responses yet

Forcing Multiple Homepages in IE 7 and Higher

An SBS customer wanted to ensure everyone had Companyweb set as their default homepage, the partners at the firm however wanted to keep MSN.  Our compromise was to set both.  Below is the solution I came up with.

1. Create a text file

2. Paste the following code into it

<%@ LANGUAGE=”VBSCRIPT” %>
<% response.buffer=true %>
<%
Const navOpenInBackgroundTab = &H1000
Set oIE = Getobject(”",”internetexplorer.application”)
oIE.Navigate2 “http://www.msn.com”
oIE.Navigate2 “http://companyweb”, navOpenInBackgroundTab
oIE.Visible = true
%>
<script language=javascript>
function CloseWindow()
{
window.open(”",”_self”,”");
window.close();
}
</script>

3. Save the file and name it something like homepages.asp

4. Place the homepages.asp file in the C:\InetPub\WWWROOT directory of a server running IIS.

5. Configure the IE homepage in a GPO to point to http://servername/homepages.asp.

When IE launches it will open the designated web pages and close the initial IE window that hosted homepages.asp.

In the event that the user manually navigates to homepages.asp and had other IE Tabs open, then just the tab that launched homepages.asp will close and a new instance of IE will be running with the two homepages.

No responses yet

Working With Exchange 2007 Clusters

I recently was setting up Exchange 2007 for CCR.  During my setup I wanted to verify that all was working and that I could move the Active Node between the two servers I had setup in my cluster.  You can’t use the Cluster Admin tools since those are not Exchange aware.  Instead you need to utilize PowerShell.  That got me thinking that it would be nice to have a script that could transfer the Active Node to the system I executed the script from.  Below is the result of my musings.

‘==========================================================================

‘ NAME: MoveCluster.vbs

‘ AUTHOR: Mark D. MacLachlan , The Spider’s Parlor
‘ URL: http://www.thespidersparlor.com
‘ DATE : //2009
‘ COPYRIGHT © 2009, All Rights Reserved

‘ COMMENT:
‘ THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
‘ ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
‘ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
‘ PARTICULAR PURPOSE.

‘ IN NO EVENT SHALL THE SPIDER’S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
‘ BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
‘ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
‘ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
‘ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
‘ OF THIS CODE OR INFORMATION.

‘==========================================================================

Set WSHNetwork = CreateObject(”Wscript.Network”)
Set WSHShell = CreateObject(”Wscript.Shell”)

ComputerName = WSHNetwork.ComputerName
Reason = InputBox(”Enter reason for moving cluster active node”)

PSCmd0 = “Start-Sleep 3;Write-Host ‘Adding Exchange Snapin’;add-pssnapin *.Exchange*;”
PSCmd1 = “Start-Sleep 3;Write-Host ‘Getting Cluster Name’;”
PSCmd2 = “$cs = Get-ClusteredMailboxServerStatus|%{$_.Identity}|%{$_.Name};”
PSCmd3 = “Write-Host ‘Cluster:’$cs;Write-Host ‘Moving Cluster Active Node To:’” & ComputerName & “;”
PSCmd4 = “Move-ClusteredMailboxServer -Identity $cs -Target ” & ComputerName & ” -MoveComment ‘” & Reason & “‘ -Confirm:$false;”
PSCMd5 = “Write-Host ‘Getting Cluster Status’;Get-ClusteredMailboxServerStatus”

WSHShell.run “Powershell -noexit -command ” & chr(34) & PSCmd0 & PSCmd1 & PSCmd2 & PSCmd3 & PSCmd4 & PSCmd5

The above also got me thinking that it would be nice to quickly access just the status information of our cluster.  That was easy enough since I was already displaying that at the end of the above script.

‘==========================================================================

‘ NAME: CheckCluster.vbs

‘ AUTHOR: Mark D. MacLachlan , The Spider’s Parlor
‘ URL: http://www.thespidersparlor.com
‘ DATE : //2009
‘ COPYRIGHT © 2009, All Rights Reserved

‘ COMMENT:
‘ THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
‘ ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
‘ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
‘ PARTICULAR PURPOSE.

‘ IN NO EVENT SHALL THE SPIDER’S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
‘ BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
‘ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
‘ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
‘ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
‘ OF THIS CODE OR INFORMATION.

‘==========================================================================

Set WSHShell = CreateObject(”Wscript.Shell”)

PSCmd0 = “Start-Sleep 3;Write-Host ‘Adding Exchange Snapin’;add-pssnapin *.Exchange*;”
PSCMd1 = “Write-Host ‘Getting Cluster Status’;Get-ClusteredMailboxServerStatus”

WSHShell.run “Powershell -noexit -command ” & chr(34) & PSCmd0 & PSCmd1

No responses yet

The PITA Program

Scenario:

You have a PITA program that you need to support (PITA= Pain In The Ass), these programs typically want you to assign the user as an admin on their local machine in order to run properly.  Needless to say this is just an invitation for disaster and you will end up with a bunch of machines with spyware and malware on them.  Ideally you should be able to just assign full control rights to the necessary registry and program files to satisfy the program.  Manually configuring such permissions can be tedious and unrealistic in large organizations or remote locations.

Solution:

We can script the setting of both registry and file permissions.  These tasks will require different utilities that you will first need to deploy to the workstations.  REGINI.EXE and XCACLS.VBS are both free Microsoft utilities.  REGINI is part of the Resource Kit Tools but is already installed in Vista machines.  Download the files to the target PCs.  You can then utilize the following script samples to set the permissions in the registry and the file system.

In the below sample we will assign full control permissions to “Everyone” to two registry keys, DumbApp1 and DumbApp2.  This sample creates a temporary text file that the REGINI program will use to set the permissions.  Once execute, the temporary file is deleted by the script.

‘==========================================================================

‘ NAME: ChangeRegistryPerms.vbs

‘ AUTHOR: Mark D. MacLachlan , The Spider’s Parlor
‘ URL: http://www.TheSpidersParlor.com
‘ COPYRIGHT (c) 2009 All Rights Reserved
‘ DATE  : 3/22/2009

‘    THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
‘    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
‘    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
‘    PARTICULAR PURPOSE.

‘    IN NO EVENT SHALL THE SPIDER’S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
‘    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
‘    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
‘    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
‘    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
‘    OF THIS CODE OR INFORMATION.

‘ COMMENT: Download REGINI in the Resource Kit Tools from Microsoft.com.

‘==========================================================================
‘First create our File System Object and Shell
Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set WSHShell = CreateObject(”WScript.Shell”)

‘ Next we create the temp file that regini.exe will use
strFileName = objFSO.GetTempName
Set objFile = objFSO.CreateTextFile(strFileName)
objFile.WriteLine “HKEY_LOCAL_MACHINE\SOFTWARE\DumbApp1 [1 5 7 11 17]”
objFile.WriteLine “HKEY_LOCAL_MACHINE\SOFTWARE\DumbApp2 [1 5 7 11 17]”
objFile.Close

‘ Now we execute REGINI to change the registry permissions
WSHShell.Run “regini ” & strFileName, 8, true

‘ Perform cleanup and delete temp file
objFSO.DeleteFile strFileName

If you are wondering what all those numbers are after the registry keys, have a look at this supporting documentation for REGINI.  Note that WORLD is “Everyone.”  Also note that whatever permissions you set override whatever was there before.

1.    Administrator Full
2.    Administrator R
3.    Administrator RW
4.    Administrator RWD
5.    Creator Full
6.    Creator RW
7.    World Full
8.    World R
9.    World RW
10.    World RWD
11.    Power Users Full
12.    Power Users RW
13.    Power Users RWD
14.    System OpFull
15.    System OpRW
16.    System OpRWD
17.    System Full
18.    System RW
19.    System R
20.    Administrator RWX

Examples:

\Registry\Machine\System\CurrentControlSet\ENUM [1 8 17] - will grant Administrator - Full Control, Everyone - Read, and System - Full Control.

\Registry\User\S-1-5-21-2053067395-480382929-641664369-1001\Software\Strange Software Thingy [1 8 17] - Same as above.

\Registry\Machine\System\CurrentControlSet\ENUM [8 17] - Will remove the Administrator group from the first example.

**************************************************

OK, so now you need to set the permissions on the program files.  Here we will use XCACLS.VBS.
‘==========================================================================

‘ NAME: ChangeNTFSPerms.vbs
‘ AUTHOR: Mark D. MacLachlan , The Spider’s Parlor
‘ URL: http://www.TheSpidersParlor.com
‘ COPYRIGHT (c) 2009 All Rights Reserved
‘ DATE  : 3/22/2009

‘    THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
‘    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
‘    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
‘    PARTICULAR PURPOSE.

‘    IN NO EVENT SHALL THE SPIDER’S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
‘    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
‘    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
‘    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
‘    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
‘    OF THIS CODE OR INFORMATION.

‘ COMMENT: Download XCACLS.VBS from Microsoft.com.

‘==========================================================================
Dim objFSO, oShell, oFolder, sXPath, sFolder, sys, DomainName
‘ Create our objects for later use
Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set oShell = Wscript.CreateObject(”Wscript.Shell”)
Set sys = CreateObject(”ADSystemInfo”)
‘Find the domain name
DomainName = sys.DomainShortName
‘Specify the path to XCACLS
sXpath =  “C:\Utilities\xcacls.vbs”
‘Specify the folders we want to set permissions on
sDrive1 = “C:\Program Files\BaddApp1?
sDrive2 = “C:\Program Files\BadApp2?
‘Now we bind to the folder and then execute XCACLS to set permissions
Set oFolder = objFSO.GetFolder(sDrive1)
sFolder = objFso.GetFolder(oFolder).ShortPath & ” “

‘Assign permissions to SYSTEM
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /I Remove /G “&Chr(34)& “System” & Chr(34)& “:F”
WScript.Sleep 2000
‘Assign permissions to DOMAIN ADMINS
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G “&Chr(34)& “Domain Admins” &Chr(34)& “:F”
WScript.Sleep 2000
‘Assign permissions to DOMAIN USERS
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G “&Chr(34)& “Domain Users” &Chr(34)& “:F”

‘Repeat the above steps for our second folder
Set oFolder = objFSO.GetFolder(sDrive2)
sFolder = objFso.GetFolder(oFolder).ShortPath & ” ”
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /I Remove /G “&Chr(34)& “System” & Chr(34)& “:F”
WScript.Sleep 2000
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G “&Chr(34)& “Domain Admins” &Chr(34)& “:F”
WScript.Sleep 2000
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G “&Chr(34)& “Domain Users” &Chr(34)& “:F”

No responses yet

Migrate Shares and Share Permissions To A New Server

Scenario:

Customer is replacing a file server with new hardware. The existing shares need to be migrated to the new server. There are far too many share permissions to document and duplicate without incurring significant cost to the customer.

Solution:

1. First use ROBOCOPY to copy the data with the required NTFS permissions. This is accomplished using the /E /SEC /COPYALL switches. Ideally the data will exist on the same drive letter on the new server as the old one, but it does not have to.

2. Open Regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Services\LanmanServer\Shares

3. Export the key and save the export to a safe location.

4. In the right pane you will see a list of all the current shares. If the server drive letters and paths are the same, proceed to step 5. Otherwise double click each share name and alter the path in the pop up window to point to where the share will exist on the new server.

5. Delete any shares listed that will not exist on the new server.

6. Export the Shares key and copy the exported file to the new server.

7. Import the registry key on the new server by double clicking the file or choose File, Import from within Regedit.

8. Reboot the server. The shares and permission will be automatically recreated.

Bonus:

If the shares are user shares that match the user name and you wish to reset permissions to allow System and Domain Admins and the user to only have access to their share, you can do so via script.

‘==========================================================================

‘ NAME: ResetNTFSUserPerms.vbs

‘ AUTHOR: Mark D. MacLachlan , The Spider’s Parlor
‘ URL: http://www.TheSpidersParlor.com
‘ COPYRIGHT (c) 2005 All Rights Reserved
‘ DATE : 1/22/2009

‘ THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
‘ ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
‘ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
‘ PARTICULAR PURPOSE.

‘ IN NO EVENT SHALL THE SPIDER’S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
‘ BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
‘ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
‘ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
‘ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
‘ OF THIS CODE OR INFORMATION.

‘ COMMENT: Download xcacls.vbs from Microsoft.com.

‘==========================================================================

Dim objFSO, oShell, oFolder, colSubfolders, oSubFolder, sXPath, sFolder, sys, DomainName
sXpath = “C:\Utilities\xcacls.vbs”
sDrive = “D:\Users\FolderRedirections\”
Set objFSO = createobject(”Scripting.FileSystemObject”)
Set oShell = Wscript.CreateObject(”Wscript.Shell”)
Set oFolder = objFSO.GetFolder(sDrive)
Set colSubfolders = oFolder.Subfolders

Set sys = CreateObject(”ADSystemInfo”)
DomainName = sys.DomainShortName

For Each oSubfolder in colSubfolders
sFolder = objFso.GetFolder(oSubfolder).ShortPath & ” ”
oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /I Remove /G “&Chr(34)& “System” & Chr(34)& “:F”

WScript.Sleep 2000

oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G “&Chr(34)& “Domain Admins” &Chr(34)& “:F”

WScript.Sleep 2000

oShell.Run “cmd /c cscript.exe ” & sXpath & ” “& sFolder & ” ” & _
” /E /G ” & DomainName &”\” & oSubfolder.Name & “:F”
Next

No responses yet
Subscribe to Tech Blog


Welcome to my technical blog.  I confess I don't update this site very frequently, but this is where you will find some technical commentary and creative solutions to technical problems I have encountered.  I hope you find the information useful, if you do then please consider supporting the Spider's Parlor by purchasing the Admin Script Pack, other Parlor tools or simply by making a donation.



Support The Parlor