Finally Someone has answered my calls.....i have been waiting for this for sooooooo long. it is going to make life easier in ConfigMgr. thanks again.
Finally Someone has answered my calls.....i have been waiting for this for sooooooo long. it is going to make life easier in ConfigMgr. thanks again.
Thanks for that script. But unfortunately, when I start it I have the following failure:
Error: Unexpected ‘Next’
Code: 800A041F
It the next after:
if foldersToDelete.Exists(i.ContentSubFolder) then
foldersToDelete.Remove(i.ContentSubFolder)
JBAB - it looks like the formating of that script is all messed up. It added Line Returns where they should not be.
The original line was:
if foldersToDelete.Exists(i.ContentSubFolder) then foldersToDelete.Remove(i.ContentSubFolder)
With a Line Return it must have an End If like this:
if foldersToDelete.Exists(i.ContentSubFolder) then
foldersToDelete.Remove(i.ContentSubFolder)
end if
Scanning through the code I don't see any other problems like this. But to fix yours either put that all on one line or add the End If.
Scott
I take my No More Line issues comment back (for IF statements it is true but not other statements).
Here are all the lines that should be 1 line to make the script work properly
for each i in WMI.ExecQuery("select pc.* from SMS_PackageToContent pc left join
SMS_CIToContent cc on cc.ContentID=pc.ContentID where pc.PackageID=""" & Pkg.PackageID & """ and
cc.ContentID is null")
for each i in WMI.ExecQuery("select pc.* from SMS_PackageToContent pc where
pc.PackageID=""" & Pkg.PackageID & """")
if foldersToDelete.Exists(i.ContentSubFolder) then
foldersToDelete.Remove(i.ContentSubFolder)
case "window": if IsObject(logWindow) then
logWindow.document.all.logLines.innerHtml = logWindow.document.all.logLines.innerHTML & msg &
"<br/>"
set logWindow = WScript.CreateObject("InternetExplorer.Application",
"Log_")
.document.body.innerHTML = "<div id=""logLines""
style='"font:10pt sans-serif;text-align:left;"" />"
' provide a way of terminating the script in windowed mode - closing the log window will
terminate the script
Make all of these lines 1 line long with proper spacing and the script will run fine.
Scott
Hi Scott
Thank you very much for your help. It's now working :)
Just a small correction:
original:
.document.body.innerHTML = "<div id=""logLines""
style='"font:10pt sans-serif;text-align:left;"" />"
should be:
.document.body.innerHTML = "<div id=""logLines"" style=""font:10pt sans-serif;text-align:left;"" />"
"" instead of '" after style=
JBAB
Would it be possible to either attach a copy of this script on here or email it to me? I can't get mine to work and I think it is because of extra line breaks that the web page is putting in it.
Great blog, great script. Just tried out the script and it worked fine after deleting all occurrences of [CR]
Can this be run as a scheduled task? It seems like the logging causes an IE window to stay running after the script executes.
This is a great post. I have an issue with using an ADR to deploy SCEP defs. You mentioned that if we use an ADR the expired content is removed from the update group which I can see. It does not remove it from the package source however. Is there any way to do this?
@ Sandy - The script provided here does the source cleanup (step 8 in the blog).
Excellent content - thanks!
excellent thing, it works both in CM 2012 and in 2007
Thanks for the script. I'm having a problem - When I run it, I get a window that says
Line: 21
Char: 1
Error: Not supported
Code: 8004100C
Source: SWbemObjectEx
any ideas?
Thanks for any help,
Steve
Script doesnt work for me ether. Fails on line 19. Can you post somewhere? You have no idea how bad I want to clean up my source directories. Its a shame that the product doesn't do this btw.