Start multiple services on a list of computers
I'm trying to write a PowerShell script to start multiple services for a computer list in a txt file. I know there has to be a way, but I'm running in circles trying to figure it out. My latest test is
Get-ContentD:\Scripts\test.txt|Foreach-Object{Get-Service-Name
'spooler'|Set-Service-StatusRunning}
Which starts the service on the server I'm running the script from. Also, the services I want to run are not on the server.
I'd appreciate any help.
Hello Geek127,
If your sample text.txt file contains a list of computernames (one per row), then you simply need to add the "-computername parameter to the Get-Service command follower
by the PS default variable $_.
Get-Content D:\Scripts\test.txt | Foreach-Object{Get-Service -Name 'spooler' -Computername $_ | Set-Service-StatusRunning }
for reference, you can check this great post from the scripting guy http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/13/powertip-use-poweshell-to-start-service-on-remote-machine.aspx
hope it helps
Best Regards / Saludos, Marianok
Disclaimer: This post, and all included code and information is provided "AS IS" with no warranties or guarantees and confers no rights. Try it at your own risk, I take no responsibilities.
Aclaración: Esta publicación, y todo en código e información en la misma, es provista "AS IS" / "Como Está" sin garantía alguna y no le confiere ningún derecho. Pruebelo su propio riesgo. No asumo responsabilidad alguna.
Similar Messages
-
Checking multiple Service status using PowerShell Workflow
Hello,
I am planning to check status of multiple services for a list of servers using Parallel. I am finding it difficult to map an object for a computer with service's status with the main object.
Below is the code:
Workflow Check-Services
PARAM([string[]]$SvCName,[string[]]$SRVList)
foreach -parallel ($computer in $SRVList)
InlineScript
$Out = @()
foreach ($service in $SvCName)
$props=[ordered]@{
ComputerName=$USING:computer;
ServiceName=$USING:service
StartUpMode=$null
State=$null }
Try
$props.StartUpMode=Get-WmiObject -class Win32_Service -ComputerName $USING:computer -ErrorAction 'Stop' | Where-Object{$_.Name -eq $USING:service} | Select-Object -ExpandProperty StartMode
if ($props.StartUpMode -eq $null) { $props.StartUpMode = "Service does not exist" }
Catch
$props.StartUpMode="Error"
Try
$props.State=Get-WmiObject -class Win32_Service -ComputerName $USING:computer -ErrorAction 'Stop' | Where-Object{$_.Name -eq $USING:service} | Select-Object -ExpandProperty State
if ($props.State -eq $null) { $props.State = "Service does not exist" }
Catch
$props.State="Error"
$Out += New-Object -TypeName PSObject -Property $props
Please help.
Thanks in advance.
RajivYOU have to learn how variables work in a workflow and how to structure PowerShell correctly. You are writing too much code because you have not understood the basics yet.
Workflow Check-Services{
Param(
[string[]]$SvCName,
[string[]]$SRVList
foreach -parallel ($computer in $SRVList){
InlineScript{
foreach ($service in $using:SvCName){
$props=[ordered]@{
ComputerName=$USING:computer
ServiceName=$service
StartMode=$null
State='Not Found'
if($s=Get-WmiObject -Filter "Name='$service'" -class Win32_Service -ComputerName $USING:computer){
$props.State=$s.State
$props.StartMode=$s.StartMode
New-Object -TypeName PSObject -Property $props
When you can make your code more readable it will be easier to see the mistakes. You had numerous errors. Go back and compare the code line by line very carefully until you understand what I changed. Ask if you cannot understand why I made
the change.
¯\_(ツ)_/¯ -
wjen i trying to activate my personal file sharing in system 10.4.11 it's not able to start this service so my network computers can't access my computer plz help or advice ??
When was the last time you did any of the following?
Restart your computer?
Repaired Permission & restarted your computer?
Run "Repair Disk" from your install DVD?
Please detail all you have done to resolve your issue. Need this information so that the users can avoid the "been there, done that" scenario type responses. This is to avoid repeating the troubleshooting you may have already tried. Thank you. -
Recently installed Diadem and there must be some sort of registry error. Whenever I startup I get the error "Attempted to start multiple instances of the service" anyone know the registry fix for this? Thanks!
Attachments:
NI startup error.jpg 16 KBHey Kyle,
Check your services and see what’s running. This can be done by going to Start>>Run and type “services.msc”. Then look for anything that starts with National Instruments or NI. Look to see if there are any entries running twice or if you are trying to call a service that is already running.
Nick
National Instruments
Applications Engineer -
Attempted to start multiple instances of the service
After installing LabVIEW 8.5.1, I keep getting this message after a computer reboot. It does not say what multiple services are running. Anyone seen this before?
SumTumWong-
Check your services and see what’s running. This can be done by going to Start>>Run and type “services.msc”. Then look for anything that starts with National Instruments or NI. Look to see if there are any entries running twice or if you are trying to call a service that is already running.
Regards,
Mike S
NI AE -
Hi, my daughter is using one of our old iphone's as an ipod (no phone service) It's listed under my apple id. when we downloaded the new updates, she started getting ALL of my incoming and outgoing text. How do I change this, without clearing her phone and loosing all her songs/etc....?
I did this on my phone. Her phone isn't activated, no cellular service. So, for whatever reason it won't even let me tap on SEND& RECEIVE, to uncheck anything
-
I recently purchased an Iphone 3gs, and already have an itunes account...Itunes wont recognize my iphone...I have uninstalled and installed itunes 2 times and keep getting this error message.
Service ‘Apple Mobile Device’ (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system services.
How do I correct?I had the same problem but managed to fix it with Amy ; the apple advisor. Here are the steps!
First of all, make sure you have the latest version of iTunes installed. You can download it from here. These instructions will NOT work for iTunes 8, 9 or 10 anymore. If you’re unsure, just uninstall iTunes then re-install with the latest files.
Next, you need to manually copy the Mobile Device Support directory from a working machine to your Windows 7 computer. Luckily, I have conveniently provided these files for you. You can download them here:
64-Bit iTunes 11.0.2: Please click here to download this directory for 64-bit Windows.
32-Bit iTunes 11.0.2: Please click here to download this directory for 32-bit Windows.
Once you download that file, you need to Unzip it to this directory. IMPORTANT: Make sure you unzip the CONTENTS of the zip file, don’t just copy over the zip file:
32-Bit: Unzip to C:\Program Files\Common Files\Apple
64-Bit: Unzip to C:\Program Files (x86)\Common Files\Apple
There are a large number of files in that directory, so it may take a little time, please be patient.
So, after unzipping, you should have a new folder “Mobile Device Support” in the Apple folder
64-BIT ONLY STEP: If you have 32-bit Windows, skip this step. It seems that Apple has put the “Drivers” in a separate location (don’t know why). You will need to download the drivers separately. Please click here to download the files for 64-bit Windows.
Once downloaded, you need to Unzip it to this directory. IMPORTANT: Make sure you unzip the CONTENTS of the zip file, don’t just copy over the zip file:
Unzip to: C:\Program FIles\Common Files\Apple
So, after unzipping, you should have a new folder “Mobile Device Support” in the Apple folder
Next, we have to merge the registry entries that will install the Apple Mobile Device service.
First, download the registry entries that I have provided for you here:
64-bit iTunes 11.0.2: Click here to download the registry entries for 64-bit Windows.
32-bit iTunes 11.0.2: Click here to download the registry entries for 32-bit Windows.
After you download the registry entries ZIP file, unzip it to your desktop and double-click each to install it. Say “Yes” to any prompts or confirmations about adding it to the registry. There are 2 entries, make sure you click BOTH and add BOTH to the registry.
Now, we need to install the correct driver for your iPhone / iTouch. Windows 7 incorrectly identifies the device as a digital camera. To fix this:
- Plug in your iPhone / iTouch (don’t have iTunes loaded at this time)
- Go to Device Manager (Click Start, right-click Computer, then click Properties. In the window that appears choose “Device Manager” on the left)
- Scroll down and find “Apple iPod” or “Apple iPhone” or “Apple iTouch”. It will likely be under the “Portable Devices” category.IMPORTANT NOTE: If your device is already listed under “Universal serial Bus Controllers” and not Portable Devices, you can skip these steps and go to Step 7.
- Right-click the Apple device and choose “Update Driver Software…”
- Choose “Browse my computer for driver software” in the window that appears
- It will ask you for a location; you want to Browse to this folder (location is the same in 32 and 64 bit Windows):
32-bit and 64-bit: C:\Program Files\Common Files\Apple\Mobile Device Support\Drivers
- Click Next
- It should find the driver for your device; let it install that driver
Once you complete these steps, reboot your computer. Once you reboot everything should work exactly as expected! -
Unable to install iTunes 11.1.4.62 on windows 8. I get
Service "Apple mobile Device) failed to start.
Verify that you have sufficient privileges to start system services.
I am trying to install it on my desktop. I am also in Administrator mode. My iTunes stopped working when I was notified that there was a new version of iTunes and would I like to download it. I said yes as always and it was unable to finish the update because of a
runtime Error!
Program: C:\program Files (x86)\iTunes\iTunes.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contace the application's suport team for more information.
My iTunes stopped working at this time. I thought I could delete iTunes and start over. This tactic did not work.
Can anyone make sense of what I am saying and help me to get my iTunes back again?Try a more recent version of my advice. The "for older video cards version" may work when the default version doesn't.
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
tt2 -
How do I fix this problem??
I received this Error Message while trying to install on my netbook again. (Service 'Apple Mobile Device' Failed to start. Verify that you have sufficient privileges to start system services. I had Itunes on already but it stop work so I uninstalled it to reinstall it but it wont work.Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?
-
Hi!
So i think i closed the wrong service at some point a few weeks back (apple mobile device) but iTunes remained working after that for another week. I then updated iTunes and i get the same "Service ‘Apple Mobile Device’ (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system services." every time. If i click ignore, just so i can access iTunes with out syncing my iPod (touch 2nd gen) i then get 'iTunes was not installed correctly. Please re-install iTunes. Error 7 (Windows error 193)" when it has all installed. I don't understand what the problem is anymore as I have looked at other questions on the apple website, carried out the advice and it hasn't work. Any of them.
Tings I have done:
- Wiped all iTunes and Apple data from my computer (if you search for 'iTunes' or 'Apple' nothing comes up apart from applets from system code.
- Attached iPod before iTunes install and updated drivers.
- Installed iTunes as 'Run as administrator'
- Uninstalled and re-installed the software nearly 20 times now and rebooted the computer in between everytime.
Please someone help because i really need to get music on my ipod and i enjoy the ease of use of iTunes compared to spotify or Windows Media Player.For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for performance issues or compatibility with QuickTime or third party software.
Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
Regarding AMDS failures there is a hint in another thread that disabling the Windows Firewall before attempting to reinstall may help, otherwise take a look at the steps outlined in this post. Re: Can't install iTunes 12.1 on Windows 7 64-bit. I know they look a little daunting, but the process of generating the logs themselves isn't that hard to do. Extracting useful information from them is still a challenge but maybe something will leap out. If you want to post the log for the failed components for me to have a look at here or in the other thread please edit out any personal information, particularly your email address, first.
tt2 -
When I get to the service section when I try to install the newest version of iTunes I get an error message. I'd really like to be able to connect to the Apple Store but can't figure out how to get those "sufficient privileges to start system services" and there doesn't seem to be any help on the Apple Support section of their Website - at least that I can find. Can anyone help me?
I uninstalled the older version of iTunes. Apparently there was a .dll missing. I also uninstalled Safari since iTunes apparently uses some of the same applications as iTunes. It's getting frustrating not being able to buy books or access the books I already have.
Thanks for any help you can provide. Sometimes computers mystify me.I am having this same problem. I took Kappy advice on restarting the Apple Mobile Device Service, however that did not work. I got this message in a pop up window that came up immediately.
Windows could not start the Apple Mobil Device Service on local computer.
Error 1053 The service did not respond to the start or control request in a timely fashion.
I have already uninstalled itunes, all the related programs and I cannot reinstall, this Apple Mobil Device message stops the install.
Can anyone please help? -
BSOD when starting MSMQ service as domain user Windows server 2012
Hi
We have a problem with a server getting BSOD when we start a service related to MSMQ. We get the attempted execute of noexecute memory BSOD whenever we start the service as a User on the domain. When we start the service as a system local it starts without
problem. I got the crashdump here:
************* Symbol Path validation summary **************
Response Time (ms) Location
Deferred SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
Microsoft (R) Windows Debugger Version 6.3.9600.17298 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\170\120314-11828-01.dmp]
Mini Kernel Dump File: Only registers and stack trace are available
************* Symbol Path validation summary **************
Response Time (ms) Location
Deferred SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
Symbol search path is: SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
Executable search path is:
Windows 8 Kernel Version 9200 MP (4 procs) Free x64
Product: Server, suite: TerminalServer SingleUserTS
Built by: 9200.16912.amd64fre.win8_gdr.140502-1507
Machine Name:
Kernel base = 0xfffff800`48476000 PsLoadedModuleList = 0xfffff800`48742aa0
Debug session time: Wed Dec 3 14:41:01.892 2014 (UTC + 1:00)
System Uptime: 0 days 0:04:09.904
Loading Kernel Symbols
Press ctrl-c (cdb, kd, ntsd) or ctrl-break (windbg) to abort symbol loads that take too long.
Run !sym noisy before .reload to track down problems loading symbols.
Loading User Symbols
Loading unloaded module list
* Bugcheck Analysis *
Use !analyze -v to get detailed debugging information.
BugCheck FC, {7f982e340e0, 791000010fdb1025, fffff8800485a5e0, 80000005}
Probably caused by : mqac.sys ( mqac!ACCreateQueue+a77 )
Followup: MachineOwner
1: kd> !analyze -v
* Bugcheck Analysis *
ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY (fc)
An attempt was made to execute non-executable memory. The guilty driver
is on the stack trace (and is typically the current instruction pointer).
When possible, the guilty driver's name (Unicode string) is printed on
the bugcheck screen and saved in KiBugCheckDriver.
Arguments:
Arg1: 000007f982e340e0, Virtual address for the attempted execute.
Arg2: 791000010fdb1025, PTE contents.
Arg3: fffff8800485a5e0, (reserved)
Arg4: 0000000080000005, (reserved)
Debugging Details:
CUSTOMER_CRASH_COUNT: 1
DEFAULT_BUCKET_ID: WIN8_DRIVER_FAULT_SERVER
BUGCHECK_STR: 0xFC
PROCESS_NAME: mqsvc.exe
CURRENT_IRQL: 0
ANALYSIS_VERSION: 6.3.9600.17298 (debuggers(dbg).141024-1500) amd64fre
TRAP_FRAME: fffff8800485a5e0 -- (.trap 0xfffff8800485a5e0)
NOTE: The trap frame does not contain all registers.
Some register values may be zeroed or incorrect.
rax=000007f982e0c950 rbx=0000000000000000 rcx=0000005dff1fecd0
rdx=0000005dff34e988 rsi=0000000000000000 rdi=0000000000000000
rip=000007f982e340e0 rsp=fffff8800485a778 rbp=fffff8800485ab80
r8=fffffa800e623980 r9=0000000000000521 r10=fffffa800ec547a0
r11=0000000000000006 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0 nv up ei pl nz na pe nc
000007f9`82e340e0 ?? ???
Resetting default scope
LAST_CONTROL_TRANSFER: from fffff80048661ef1 to fffff800484d0540
STACK_TEXT:
fffff880`0485a408 fffff800`48661ef1 : 00000000`000000fc 000007f9`82e340e0 79100001`0fdb1025 fffff880`0485a5e0 : nt!KeBugCheckEx
fffff880`0485a410 fffff800`48588980 : fffff880`0485a5e0 ffffd8e9`9e6056e2 fffffa80`0ec547a0 00000000`00000000 : nt! ?? ::FNODOBFM::`string'+0x33f2d
fffff880`0485a450 fffff800`4850aabd : fffff880`0485a500 00000000`c0000016 fffffa80`0e603b00 fffffa80`0e623980 : nt! ?? ::FNODOBFM::`string'+0x33e85
fffff880`0485a4a0 fffff800`484cdfee : 00000000`00000008 00000000`00000000 00000000`00000000 fffff880`0485a5e0 : nt!MmAccessFault+0x3ed
fffff880`0485a5e0 000007f9`82e340e0 : fffff880`00dc5297 fffffa80`0ec54770 00000000`00000000 fffff8a0`011ce7c0 : nt!KiPageFault+0x16e
fffff880`0485a778 fffff880`00dc5297 : fffffa80`0ec54770 00000000`00000000 fffff8a0`011ce7c0 fffff980`00000000 : 0x000007f9`82e340e0
fffff880`0485a780 fffff880`00dc60d7 : 00000000`00000000 0000005d`ff34e988 00000000`00000000 00000000`00000000 : mqac!ACCreateQueue+0xa77
fffff880`0485a7f0 fffff800`488ab127 : fffffa80`0e5ed520 fffffa80`0d50ecf0 00000000`00000521 00000000`00000000 : mqac!ACDeviceControl+0x62b
fffff880`0485a890 fffff800`488c02f6 : 00000000`00000000 fffff8a0`00000080 00000000`00000000 00000000`00000000 : nt!IopXxxControlFile+0x7e5
fffff880`0485aa20 fffff800`484cf553 : 00000000`00000000 00000000`0000000c fffff6fb`7dbed078 fffff6fb`7da0ff30 : nt!NtDeviceIoControlFile+0x56
fffff880`0485aa90 000007f9`8a702c1a : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KiSystemServiceCopyEnd+0x13
0000005d`ff34e928 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x000007f9`8a702c1a
STACK_COMMAND: kb
FOLLOWUP_IP:
mqac!ACCreateQueue+a77
fffff880`00dc5297 85c0 test eax,eax
SYMBOL_STACK_INDEX: 6
SYMBOL_NAME: mqac!ACCreateQueue+a77
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: mqac
IMAGE_NAME: mqac.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 5010abc2
IMAGE_VERSION: 6.2.9200.16384
BUCKET_ID_FUNC_OFFSET: a77
FAILURE_BUCKET_ID: 0xFC_mqac!ACCreateQueue
BUCKET_ID: 0xFC_mqac!ACCreateQueue
ANALYSIS_SOURCE: KM
FAILURE_ID_HASH_STRING: km:0xfc_mqac!accreatequeue
FAILURE_ID_HASH: {d1daca31-6256-358c-65b5-69af54392880}
Followup: MachineOwnerHi,
For BugCheck FC, it indicates that an attempt was made to execute non-executable memory. For more details,
please refer to following article.
Bug Check 0xFC: ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY
à
whenever we start the service as a User on the domain
. When we start the service as a system local it starts without problem
Did you mean that just use a standard domain user account to start the service, then encounter the issue? If
configure Log on as Local System account, will no BSOD issue occurred? Just a confirmation, thanks for your understanding.
Please check if you install all necessary Windows Updates on the server.
In addition, as you know, troubleshoot this kind of kernel crash issue, we need to analyze the crash dump file to narrow down the root cause of the issue. However, it is
not effective for us to debug the crash dump file here in the forum. If this issues is a state of emergency for you. Please contact Microsoft Customer Service and Support (CSS) via telephone so that a dedicated Support Professional can assist with your request.
To obtain the phone numbers for specific technology request, please refer to the web site listed below:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone#faq607
Hope this helps.
Best regards,
Justin Gu -
How can I kick out a older computer from the list of computers that have access to CC?
When I want to start an CC app it says there are already 2 computers using Adobe CC on my account. How can I manage the list of computers in this list?
I checked it out by myself: I could quit my CC account on the old computer with Creative Cloud Desktop App > Preferences > Delete account on this computer.
-
I updated iTunes 10.3.1 today, and now it won't let me openitunes it keeps saying error 7 (windows error 14001) and also says (apple mobile failed to startverify significant privileges to start system services) I have unstalled it severaltimes, tried repairing it also switched off all security software and checkedall files are deleted in local disk (program file) but still no look. Please cansomeone help
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for performance issues or compatibility with QuickTime or third party software.
Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
Regarding AMDS failures there is a hint in another thread that disabling the Windows Firewall before attempting to reinstall may help, otherwise take a look at the steps outlined in this post. Re: Can't install iTunes 12.1 on Windows 7 64-bit. I know they look a little daunting, but the process of generating the logs themselves isn't that hard to do. Extracting useful information from them is still a challenge but maybe something will leap out. If you want to post the log for the failed components for me to have a look at here or in the other thread please edit out any personal information, particularly your email address, first.
tt2 -
Amending script to read list of computers, run script and output to log file
Hello all,
I have cobbled together a script that runs and does what I want, now I would like to amend the script to read a list of computers rather than use the msg box that it is currently using for the strcomputer, if the computers doesn't respond to a ping, then
log that, if it does continue with the script and when it is complete, log a success or failure. I have just started scripting and would really appreciate some help on this one,thanks. I created the script to fix an SCCM updates issue and failing task sequences,
so it may prove useful to others.
There are msg box entries that can be removed that were originally in there for the user running the script.
'setting objects
Dim net, objFSO, shell
Dim objFile, strLine, intResult
Set objnet = CreateObject("wscript.network")
Set objFSO = CreateObject("scripting.filesystemobject")
Set objshell = CreateObject("wscript.shell")
strfile = "c:\wuafix\wuafix.vbs"
strUser = "domain\user"
strPassword = "password"
'getting server name or IP address
strComputer=InputBox("Enter the IP or computer name of the remote machine on which to repair the WUA agent:", "Starting WUA Fix")
'check to see if the server can be reached
Dim strPingResults
Set pingExec = objshell.Exec("ping -n 3 -w 2000 " & strComputer) 'send 3 echo requests, waiting 2secs each
strPingResults = LCase(pingExec.StdOut.ReadAll)
If Not InStr(strPingResults, "reply from")>0 Then
WScript.Echo strComputer & " did not respond to ping."
WScript.Quit
End If
'Check if source file exists
If Not objFSO.FileExists(strFile) Then
WScript.Echo "The source file does not exist"
WScript.Quit
End If
MsgBox "The WUA Fix is in process. Please wait.", 64, "Script Message"
'mapping drive to remote machine
If objFSO.DriveExists("Z:") Then
objnet.RemoveNetworkDrive "Z:","True","True"
End If
objnet.MapNetworkDrive "Z:", "\\" & strComputer & "\c$", True
'creating folder for install exe on remote machine
If (objFSO.FolderExists("Z:\wuafix\") = False) Then
objFSO.CreateFolder "Z:\wuafix"
End If
'copying vbs to remote machine
objFSO.CopyFile strFile, "Z:\wuafix\wuafix.vbs"
'set command line executable to run a silent install remotely
strInstaller1 = "cscript.exe c:\wuafix\wuafix.vbs"
'strInstaller2 = "c:\wuafix\wuafix.vbs"
strExec = "c:\pstools\PsExec.exe "
'objshell.Run strExec & " \\" & strComputer & strInstaller1
On Error Resume Next
result = objshell.Run(strExec & " \\" & strComputer & " " & strInstaller1)
If Err.Number = 0 Then
WScript.Echo "PSXEC Runing WUA fix remotely"
Else MsgBox Err.Number
MsgBox result
End If
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'Application' AND " _
& "EventCode = '4'")
Wscript.Echo "Event Viewer checked and Fix Applied:" & colLoggedEvents.Count
MsgBox "Removing mapped drive Please wait.", 64, "Script Message"
If objFSO.DriveExists("Z:") Then
objnet.RemoveNetworkDrive "Z:","True","True"
End If
MsgBox "The WUA Fix has been applied.", 64, "Script Message"
quit
wscript.quit
Any help appreciated and explanations on the process would be great as I would like to learn the process involved, which is difficult when working during the day.
many thanksHi Bill,
long story short, I have approx. 2800 clients with an old entry in WMI for updates that the sccm client cannot clear or run because they do not exist anymore, so the client will not run updates or use a task sequence because of this, so my script fixes this
and does a couple of other things, I have found another way to do this by running a different script that uses WMI to call a cscript function that uses the wuafix.vbs that is coped to the machine, I am also changing the echo entries to output to a log
file instead so that I can track what client has run the fix andn which ones haven't.
If you have any suggestions then please let me know, nothing nefarious :)
many thanks
Maybe you are looking for
-
Using one PC for two different iphone
My wife and I got the Iphone3GS recently. But, we just shared a PC at home. Are there any method to syn our materials on the same PC with different account?
-
Only able to connect to internet through Broadband DSL one computer at a time.
Hi, I am using Verizon Broadband DSL, and have used it for a few years. Equipment: Westell Versalink Model 327W Linksys Wireless-G Broadband Router Model WRT54G I have a desktop (running Windows XP), and 2 laptops (1 XP, 1 Vista) that are connected w
-
TS3048 My wireless keyboard does not turn on. Yes batteries are new and installed correctly
I don't know why my wireless keyboard is not working. I can't sign onto my computer. Installed new batteries and yes they are installed correctly. I'm wondering if maybe it doesn't work anymore. It's only a couple of years old!
-
Video options almost all grayed out -- but camera works
+(Accidentally posted this in iChat 3.0 forum: meant to post here)+ A number of quite important options are grayed out of my iChat, and I don't know why. For example, under Buddies, I can't select anything under "Send Instant Message". Most important
-
Enhancement for COR1,COR2,COR3 - PPCO0020 - to add custom field on screen
Hello Experts, My requirement is to add a custom tab and in that a custom field for TCODE COR1. I have done this by creating a project from cmod for enhancement PPCO0020. Added the custom field to table AUFK and structure CAUFVD. the field name is KD