myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


ITunes

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> ITunes Page: [1]
Login
Message << Older Topic   Newer Topic >>
ITunes - 11/10/2008 12:31:03 PM   
smsengineer

 

Posts: 45
Score: 0
Joined: 7/24/2006
Status: offline
I would like to uninstall ITunes on our users' computers and to keep running the program if they decide to install the software again.
Does anyone know the best way to run this objective?

Post #: 1
RE: ITunes - 11/10/2008 12:44:13 PM   
skissinger


Posts: 2293
Score: 145
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Assuming iTunes puts the installation date in ARP, base your query on ARP installation date for this product is less than 11/10/08 (I think it does?).  If the install date is greater than that date, the collection won't have the resource listed.

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to smsengineer)
Post #: 2
RE: ITunes - 11/10/2008 12:55:06 PM   
rtruss


Posts: 254
Score: 11
Joined: 11/4/2004
Status: offline
You could create a collection that is based on the itunes.exe and if exists on a system then put that system in the collection and then the reoccuring itunes script should run automatically.  The way we handle it is via the registry.  I created a utility called app blocker and it locks down given reg entries and or 'dummy' files in the program files folder.  If the app already exists then the folder of the app is locked down and the user can no longer run it.  Currently it gives specific groups rights to modify the files/folders/reg entries like domain admins or tech support.  Everyone else is blocked from even seeing the files.  We use it when we build a system.  I built it in to one of our automated steps to 'brand' our systems.  It is a script that reads a 'config' file and works it magic based on what is in the 'config' file.  This allows us to leave the actual script as is and then just update teh ini file with the new app if needed.

Here they are... (appblock.vbs and appblock.ini)

ini file snipit...
;=====================================================================
; INI Source File -- Created with XLnow OnScript
;
; AUTHOR:  Roger Truss
; COMPANY: Mercury Marine
; DATE:    10/15/2007
; COMMENT: This ini file is used by the appblocker script to stop the
;     installs of unwanted apps.
;=====================================================================
;
;
; now with the addition of reg blocking, folder blocking is no longer needed for many apps
;
;
[ use the bracket as a section header anything on a line]
[ with a bracket is ignored.  this is a std ini function]
[in-line comments]
;use the smi-colon as a in-line comment as the script
;reads upto that point and uses everything to the left of it
;the asterics "*" is used to create "files" in the root of the file system, it MUST be the FIRST Character in the line to work
;the lessthan "<" is used to work with the HKCU and HKEY_USERS\.DEFAULT registry, it MUST be the FIRST Character in the line to work
;the pipe "|" is used to work with the HKLM registry, it MUST be the FIRST Character in the line to work
;NOTE: this utility only covers the DEFAULT install locations.
;Later i will setup the script to modify registry entries for the
;apps so end users won't be able to install the app at all no matter
;which folder the try to install it to.
[folder options]
;items with a backslash in them will create
;the file in the folder to the left of the backslash if it exists
;if the item to the left of the backslash does not exist already
;the script creates a folder with that name
;if the item to the left of the backslash is a file then the line is skipped
;blank lines are skipped
[security step]
;the final step in the process is to remove all rights for the
;ADMINISTRATORS, EVERYONE and USERS groups
;ADDs full control to the DOMAIN ADMINS group and whatever group you see fit.
;this forces other admins to have to take control of the file/folder
;then assign permissions and then delete the file.
[]
;starting with unknown section this is the actual code that the vbscript will read
;and then setup on your system(s)
;feel free to add and comment at will.
[unknown]
|software\781
|SOFTWARE\BackWeb  ;poss koday file share or update service.
thq
pradis
staples easy button
Susteen ; looks like cell phone stuff
TeamCU ;possible aviation stuff
|Software\Trymedia Systems
dst_suns ;Distant Suns SETI App.
|Software\$sys$reference
;possible phone software    C:\Program Files\Nokia\Nokia PC Suite 6\styles
<Software\Trolltech
;no idea yet
|SOFTWARE\PC Connectivity Solution
;another yet unknown app
<Software\Sony Corporation\Yebisu
<Software\JEDI-VCL ;some kind of tip-o-the-day
[audio video apps]
|Software\Apple Computer, Inc.\bonjour
|Software\Apple Computer, Inc.\iPod
|Software\Apple Computer, Inc.\iTunes
|Software\Microsoft\Windows\CurrentVersion\Uninstall\{B5C209B1-8DDB-4642-A573-375B951514CB}
;iphone ;this is just a guess as I am not made of money (it may use itunes or ipod)
;ipod
;itunes
microids
MPlayer for Windows
PC Friendly
InterActual ;dvd player
|Software\InterActual Technologies
Real
|Software\Realnetworks\RhapsodySDK
|Software\Realnetworks\Update
<Software\Realnetworks\RhapsodySDK
<Software\Realnetworks\Update
real player
sony\sonicstage
sony\openmg
sony\openmg Jukebox

----  vbscript  ----

'***********************************************************************
' settings and variables section
'***********************************************************************
Set wshShell = CreateObject("Wscript.Shell")
Set WshNetwork = CreateObject("Wscript.Network")
Set WshSystemEnv = WshShell.Environment("SYSTEM")
Set WshProcessEnv = WshShell.Environment("PROCESS")
Set WshUserEnv = WshShell.Environment("USER")
sUserDomain = WshNetwork.UserDomain
sComputerName = WshNetwork.ComputerName
sUserName = WshNetwork.UserName
nethomeshare =  WshProcessEnv("HOMESHARE")
nethomedrive =  WshProcessEnv("HOMEDRIVE")
sScriptName = WScript.ScriptFullName' required in the original code that calls this file
sScriptPathLen = InStrRev(sScriptName,"\",-1,1)' required in the original code that calls this file
sScriptPath = Left(sScriptName,sScriptPathLen - 1)' required in the original code that calls this file
sTrimmedScriptName = Right(sScriptName, Len(sScriptName)-2)' required in the original code that calls this file
nPos1 = Instr(1,sTrimmedScriptName,"\",1)' required in the original code that calls this file
sSMSServerName = Left(sTrimmedScriptName,nPos1-1)' required in the original code that calls this file
Set oFSO = CreateObject("Scripting.FileSystemObject")' required in the original code that calls this file
Const ForReading = 1, ForWriting = 2, ForAppending = 8' required in the original code that calls this file
nOneSecond = 1000
nOneMinute = nOneSecond * 60
nOneHour = nOneMinute * 60
'Date Settings
sMonth = Month(date)
If Len(sMonth) = 1 Then sMonth = "0" & sMonth
sDay = Day(date)
If Len(sDay) = 1 Then sDay = "0" & sDay
sDate = Year(date) & "-" & sMonth & "-" & sDay
'Time Settings
sHour = Hour(Now)
sMin = Minute(Now)
sSec = Second(Now)
If Right(now,2) = "PM" then
sAPM = "PM"
else
sAPM = "AM"
End If
sTime = sHour & ":" & sMin & ":" & sSec & " " & sAPM
sCorpKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization"
sCorpName = WshShell.RegRead(sCorpKey)
sCorpDivisionKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOwner"
sCorpDivision = WshShell.RegRead(sCorpDivisionKey)
sSystemVersionKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion"
sSystemVersion = WshShell.RegRead(sSystemVersionKey)
on error resume next
sSPVersionKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion"
sSPVersion = WshShell.RegRead(sSPVersionKey)
sIEVersionKey = "HKLM\Software\Microsoft\Internet Explorer\Version"
sIEVersion = WshShell.RegRead(sIEVersionKey)
on error goto 0
On Error Resume Next
Err.Clear
sTSVersionKey = "HKLM\SOFTWARE\Microsoft\TermServLicensing\lrwiz\params\www"
sTSVersion = WshShell.RegRead(sTSVersionKey)
nTSVersionError = Err.Number
Err.Clear
on error goto 0
sSystemRootKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot"
sSystemRoot = WshShell.RegRead(sSystemRootKey)
sProdNameKey = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProductName"
sProdName = WshShell.RegRead(sProdNameKey)
sProgramFilesDirKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir"
sProgramFilesDirprep = WshShell.RegRead(sProgramFilesDirKey)
If ofso.folderexists(sProgramFilesDirPrep & " (x86)") then
sProgramFilesDir = "C:\Program Files"
sAppPathKey = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths"
else
sProgramFilesDir = WshShell.RegRead(sProgramFilesDirKey)
sAppPathKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
end if
'**************************
' Package naming structure.
'**************************
sInstalledFrom  = "IUB"  'This is used to tell the script what default groups you need and IUB is a OS Build tool from Lenovo called ImageUltra Builder.
sInstallType    = "Windows App Blocker" '"setup" or "update" or "remove" or "upgrade"
sInstallVer  = "6.0"
sInstallName    = "Corporation"
sInstallMaker   = "Brunswick"
Dim secGroups, sABGroup1, sABGroup2
dim nValue, aDivisions, Division, sSetACL
Redim aDivisions(nIdx)
Dim objie, bdone, objdoc, objitem,onclick,button1,button2  
title = sInstallMaker & " " & sInstallName & " " & sInstallType & " Utility " & sInstallVer & " for PC: " & sComputerName
Msg = UCase(susername) & " has initiated the " & sInstallMaker & " " & sInstallName & " " & sInstalltype & " " & sInstallver & "." & Vbcrlf & Vbcrlf
Select Case UCase(sInstalledFrom)
Case "SMS"
Case Else     WshShell.Popup msg,10, title, 64
End Select
Select Case UCase(Left(sComputername, 3))
Case "BBX"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case "BCX"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case "CAP"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case "FDL"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case "HST"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support  
case "MIA"
 sABGroup1 = ""
 sABGroup2 = ""
Case "MPP"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case "OSH"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
case "PAN"
 sABGroup1 = ""
 sABGroup2 = ""
Case "RSL"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
case "SIP"
 sABGroup1 = ""
 sABGroup2 = ""
case "STC"
 sABGroup1 = ""
 sABGroup2 = ""
case "STW"
 sABGroup1 = "(A;OICI;FA;;;S-1-5-21-132666782-1763787139-199955091-1049)"'DeviceUpdaters
case "TOR"
 sABGroup1 = ""
 sABGroup2 = ""
Case "TSM"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
case "TUL"
 sABGroup1 = "(A;OICI;FA;;;S-1-5-21-737150527-126451658-701057205-3989)" ' tulsa pc updater group
Case "ZRT"
 sABGroup1 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-21401)"'Windows Mgmt
 sABGroup2 = "(A;OICINP;FA;;;S-1-5-21-101409707-1513554684-1147875810-1182)"'Tech support
Case Else 'all other systems
 sABGroup1 = ""
 sABGroup2 = ""
End Select 
SecGroups = " /sddl=O:DAG:DUD:PARAI(A;OICINP;FA;;;DA)(A;OICINP;FA;;;LA)" & sABGroup1 & sABGroup2' & " /REVOKE=administrators /REVOKE=""Creator Owner"" /REVOKE=Everyone /REVOKE=Users /REVOKE=SYSTEM /REVOKE=""POWER USERS"""
'***********************************************************************
'sets up the local log file directory.
'***********************************************************************
sLogFolder = sProgramFilesDir & "\InstallWrapper"
If Not oFSO.FolderExists(sLogFolder) Then oFSO.CreateFolder(sLogFolder)
sLogFolder = sProgramFilesDir & "\InstallWrapper\" & sInstallMaker
If Not oFSO.FolderExists(sLogFolder) Then oFSO.CreateFolder(sLogFolder)
sLogFolder = sProgramFilesDir & "\InstallWrapper\" & sInstallMaker & "\" & sInstalltype & " " & sInstallver
If Not oFSO.FolderExists(sLogFolder) Then oFSO.CreateFolder(sLogFolder)
'***********************************************************************
'sets up the local log file directory.
'***********************************************************************
sSMSLogFolder = sProgramFilesDir & "\InstallWrapper"
If Not oFSO.FolderExists(sSMSLogFolder) Then oFSO.CreateFolder(sSMSLogFolder)
'***********************************************************************
'preps the installwrapper log file name.
'***********************************************************************
sSMSLogFile = sSMSLogFolder & "\SMS-Installs.log"
If oFSO.FileExists(sSMSLogFile) Then
Set oSMSLogFile = oFSO.OpenTextFile(sSMSLogFile, ForAppending)
Else
Set oSMSLogFile = oFSO.CreateTextFile(sSMSLogFile, ForWriting)
End If
oSMSLogFile.WriteLine Date & VBTab & Time & VBTab & sSMSServerName & VBTab & sInstallMaker & VBTab & sInstallName & VBTab & sInstalltype & VBTab & sInstallVer
oSMSLogFile.close
set oSMSLogFile = Nothing
'***********************************************************************
'preps the installwrapper log file name.
'***********************************************************************
sLogFile = sLogFolder & "\" & sInstallType & " " & sInstallVer & ".log"
If oFSO.FileExists(sLogFile) Then
oFSO.DeleteFile(sLogFile)
Set oLogFile = oFSO.CreateTextFile(sLogFile, ForAppending)
Else
Set oLogFile = oFSO.CreateTextFile(sLogFile, ForWriting)
End If
oLogFile.WriteLine "Log Start. " & sInstallMaker & " " & sInstallName & " " & sInstallType & " " & sInstallver & ".vbs"
oLogFile.WriteLine ""
oLogFile.WriteLine UCase(susername) & " initiated the " & sInstallMaker & " " & sInstallName & " " & sInstalltype & " " & sInstallver & " on " & sComputerName & " at " & now & "."
'***********************************************************************
'begin the file/folder secureing process
'***********************************************************************
WinACLexe = ssystemroot & "\system32\cacls.exe"
Dim sfilepath, f, ofile, strApp2Block, winDBD, PFFolder
Dim strFileName, app2block, app2blockpos, folder2mod, apprt2block, apprt2blockpos, reg2block, reg2blockpos
Dim fldr2makepos, fldr2make, App4Blocking, spfdir
aprogrmsroot = Array(sProgramFilesDir,sProgramFilesDir & " (x86)")
'********************************
' Preps the security prep utility bar files.
'********************************
ofso.CopyFile(sScriptPath & "\subinacl.exe"), (ssystemroot & "\system32\"), true
RegACLexe = ssystemroot & "\system32\subinacl.exe"
'********************************************
'setup and read the ini file
'********************************************
strFileName = sscriptpath & "\appblock.ini"
Set oFile = oFso.OpenTextFile(strFileName, 1)
Do Until oFile.AtEndOfStream
App2Block = ""
Apprt2Block = ""
reg2Block = ""  
Folder2Mod = ""
StrApp2Block = ""
strApp2Block = oFile.ReadLine
strApp2Block = trim(strApp2Block)
app2blockpos=InStr(strApp2Block,";") -1 
If app2blockpos = -1 then app2blockpos = Len(strApp2Block)
App2Block = Left(strApp2Block,app2blockpos)
App2Block = trim(App2Block)

select case Left(App2Block,1)
 case"["
 case"*"' used to create secured files in the root of C:\
  app2Block = Right(App2Block, Len(App2Block)-1) 
  CheckIt("C:")
 Case"<" ' used to lock the reg files for a given app in HKLM so as to block the install
  Reg2Block = Right(App2Block, Len(App2Block)-1) 
  runreglockHKCU
 Case"|" ' used to lock the reg files for a given app in HKLM so as to block the install
  Reg2Block = Right(App2Block, Len(App2Block)-1) 
  runreglockHKLM
 case else runpffiles
end select
Loop
'---------------------------------------------------------------------------------
sub runpffiles
If App2Block = "" then
Else
 For Each PFFolder In aprogrmsroot
  If ofso.FolderExists(PFFolder) then CheckIt(PFFolder)
 Next
End If
end sub 'runpffiles
'---------------------------------------------------------------------------------
sub runcroot
If App2Block = "" then
Else
CheckIt("C:")
End If
end sub 'runcroot
'---------------------------------------------------------------------------------
Sub CheckIt(spfdir)
If Instr(strApp2Block,"\") then
 fldr2makepos=InStr(strApp2Block,"\") -1
 fldr2make = Left(strApp2Block,fldr2makepos)
 folder2mod = spfdir & "\" & fldr2make
 If NOT Ofso.FileExists(folder2mod) then
  If NOT Ofso.FolderExists(folder2mod) then
   ofso.CreateFolder(folder2mod)
   'hideroot(spfdir)
   blockit(spfdir)
  Else
   'hideroot(spfdir)
   blockit(spfdir)
  End If
 Else
  blockit(spfdir)  
 End If
Else
 blockit(spfdir)
end if
End Sub ' CheckIt
'---------------------------------------------------------------------------------
Sub hideroot(spfdir)
'**************************************************
'setup the hidden bit for the root folder of an app
'**************************************************
If ofso.FolderExists(folder2mod) then
 Set f = ofso.GetFolder(folder2mod)
 If f.attributes And 2 Then
  oLogFile.WriteLine "No need to set the hidden bit for the FOLDER: " & folder2mod & "." 
 Else
  f.attributes = f.attributes + 2
  oLogFile.WriteLine "Set the hidden bit for the FOLDER: " & folder2mod & "." 
  msg = "HIDEROOT: " & spfdir & "   sfilepath: " & folder2mod
  'WshShell.Popup msg,10, title, 64
 end if
End If
end Sub
'---------------------------------------------------------------------------------
sub blockit(spfdir)
'************************************************
'look for the file/folder and call the hideit sub
'************************************************
If ofso.FolderExists(spfdir & "\" & app2block) then
 sfilepath = spfdir & "\" & app2block
 Set f = ofso.GetFolder(sfilepath)
 msg = "blockit folder existing: " & sfilepath
 'WshShell.Popup msg,10, title, 64
 hideit(spfdir)
else
 If ofso.FileExists(spfdir & "\" & app2block) then
  sfilepath = spfdir & "\" & app2block
  Set f = ofso.GetFile(sfilepath)
  msg = "blockit file existing: " & sfilepath
  'WshShell.Popup msg,10, title, 64
  hideit(spfdir)
 Else
  If ofso.FileExists(folder2mod) then
   sfilepath = folder2mod
   Set f = ofso.GetFile(sfilepath)
   msg = "blockit folder as file: " & sfilepath & " folder2mod: " & folder2mod
   'WshShell.Popup msg,10, title, 64
   HideIt(spfdir)   
  Else
   ofso.CreateTextFile(spfdir & "\" & app2block)
   sfilepath = spfdir & "\" & app2block
   Set f = ofso.GetFile(sfilepath)
   msg = "blockit new file: " & sfilepath
   'WshShell.Popup msg,10, title, 64
   hideit(spfdir)
  End If
 end if
end if
end sub
'---------------------------------------------------------------------------------
Sub hideit(spfdir)
'******************************************************
'setup read only and hidden bits for the file or folder
'******************************************************
If Instr(App2Block,"\") then
 sobject_type = "/subdirectories"
 'sfilepath = folder2mod & "\*.*"
 sfilepath = sfilepath & "\*.*"
else
 sobject_type = "/File"
end if
'If NOT ofso.FolderExists(sLogFolder&"\logs_file")then ofso.CreateFolder(sLogFolder&"\logs_file")
'sInstall = RegACLexe & " /outputlog="""&sLogFolder&"\logs_file\"&app2block&".log"" /verbose " & sobject_type & " """ & sfilepath & """ " & SecGroups
sInstall = RegACLexe & " " & sobject_type & " """ & sfilepath & """" & SecGroups
oLogFile.WriteLine sinstall
On error resume next
WshShell.Run sInstall, 1, True
On error goto 0
If f.attributes And 1 Then
Else
 f.attributes = f.attributes + 1
End If
If f.attributes And 2 Then
Else
 f.attributes = f.attributes + 2
End If
end sub
'---------------------------------------------------------------------------------
Sub runreglockHKCU
'******************************************************
'setup read only and hidden bits for the regitry item
'******************************************************
If Instr(Reg2Block,"}") then
 sobject_type = "/keyreg"
else
 sobject_type = "/subkeyreg"
end if
'If NOT ofso.FolderExists(sLogFolder&"\logs_reg")then ofso.CreateFolder(sLogFolder&"\logs_reg")
On Error resume next
sReadit = WshShell.RegRead("HKCU\" & Reg2Block & "\")
If err.number <> 0 then
 WshShell.Regwrite("HKCU\" & Reg2Block &"\" ),"Registry entry locked by the Windows Management team","REG_SZ"
 oLogFile.WriteLine "Created the reg key " & Reg2Block
else
 WshShell.Regwrite("HKCU\" & Reg2Block &"\Winmgmt" ),"Existing registry entry locked by the Windows Management team","REG_SZ"
End If  

'sInstall = RegACLexe & " /outputlog="""&sLogFolder&"\logs_reg\"&reg2block&"HKCU.log"" " & sobject_type & " ""HKEY_CURRENT_USER\" & Reg2Block & """" & SecGroups
sInstall = RegACLexe & " " & sobject_type & " ""HKEY_CURRENT_USER\" & Reg2Block & """" & SecGroups
oLogFile.WriteLine ""
oLogFile.WriteLine sInstall
WshShell.Run sInstall, 1, True
 
On Error resume next
sReadit = WshShell.RegRead("HKEY_USERS\.DEFAULT\" & Reg2Block & "\")
If err.number <> 0 then
 WshShell.Regwrite("HKEY_USERS\.DEFAULT\" & Reg2Block &"\" ),"Registry entry locked by the Windows Management team","REG_SZ"
 oLogFile.WriteLine "Created the reg key " & Reg2Block
else
 WshShell.Regwrite("HKEY_USERS\.DEFAULT\" & Reg2Block &"\Winmgmt" ),"Existing registry entry locked by the Windows Management team","REG_SZ"
End If 
sInstall = RegACLexe & " " & sobject_type & " ""HKEY_USERS\.DEFAULT\" & Reg2Block & """" & SecGroups
oLogFile.WriteLine ""
oLogFile.WriteLine sInstall
WshShell.Run sInstall, 1, True 
end sub
'---------------------------------------------------------------------------------
Sub runreglockHKLM
'******************************************************
'setup read only and hidden bits for the regitry item
'******************************************************
If Instr(Reg2Block,"}") then
 sobject_type = "/keyreg"
else
 sobject_type = "/subkeyreg"
end if 
'If NOT ofso.FolderExists(sLogFolder&"\logs_reg")then ofso.CreateFolder(sLogFolder&"\logs_reg")
On Error resume next
sReadit = WshShell.RegRead("HKLM\" & Reg2Block & "\")
If err.number <> 0 then
 WshShell.Regwrite("HKLM\" & Reg2Block &"\" ),"Registry entry locked by the Windows Management team","REG_SZ"
 oLogFile.WriteLine "Created the reg key " & Reg2Block
else
 WshShell.Regwrite("HKLM\" & Reg2Block &"\Winmgmt" ),"Existing registry entry locked by the Windows Management team","REG_SZ"
End If  
'sInstall = RegACLexe & " /outputlog="""&sLogFolder&"\logs_reg\"&reg2block&".log"" /subkeyreg ""HKEY_LOCAL_MACHINE\" & Reg2Block & """" & SecGroups
'sInstall = RegACLexe & " /outputlog="""&sLogFolder&"\logs_reg\"&reg2block&".log"" " & sobject_type & " ""HKEY_LOCAL_MACHINE\" & Reg2Block & """" & SecGroups
sInstall = RegACLexe & " " & sobject_type & " ""HKEY_LOCAL_MACHINE\Software\" & Reg2Block & """" & SecGroups
'If Instr(Reg2Block,"}") then msgbox sinstall
oLogFile.WriteLine ""
oLogFile.WriteLine sInstall
WshShell.Run sInstall, 1, True
end sub
'---------------------------------------------------------------------------------
'***********************************************************************
' Final cleanup
'***********************************************************************
oLogFile.WriteLine ""
oLogFile.WriteLine "The " & sInstallMaker & " " & sInstallName & " " & sInstalltype & " " & sInstallver & " completed at " & now & "."
Msg = "The " & sInstallMaker & " " & sInstallName & " " & sInstalltype & " " & sInstallver & " is complete." & Vbcrlf & Vbcrlf
 Select Case UCase(sInstalledFrom)
  Case "SMS"
  Case Else     WshShell.Popup msg,10, title, 64
 End Select





_____________________________

Roger Truss
Assistant Windows Administrator
SMS Admin
Trend Micro Admin
ImageUltra Admin

Please rate my post ;)

(in reply to smsengineer)
Post #: 3
RE: ITunes - 11/10/2008 1:52:34 PM   
rbennett806


Posts: 885
Score: 18
Joined: 6/14/2006
Status: offline
Might also check out this post: http://www.myitforum.com/forums/Script_for_removing_Itunes/m_137162/tm.htm

(in reply to rtruss)
Post #: 4
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> ITunes Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.609