Hi there, what’s happening is that actionscript uses percent encoding to escape special characters, so your percent sign is getting “eaten”.
Try this in a task/fixlet (not the QnA Fixlet Debugger) and it should work. Note how I replace the percent sign with %25. In the link I provided, you will want to look at the symbol column, then the hex column.
This is not working in my test. I’ve tested this in 2 computers.
One time like you:
waithidden vssadmin resize shadowstorage /for=C: /on=C: /maxsize={“10” & “%25”}
And on other time like this
waithidden CMD.EXE /C vssadmin resize shadowstorage /for=C: /on=C: /maxsize={“10” & “%25”}
Earlyer I’ve tried waithidden CMD.EXE /C vssadmin resize shadowstorage /for=C: /on=C: /maxsize=10%%
and when I see the command on the client the % was there but no result too
I think there is a right problem or Something, because when I launch a CMD as administrator and i put this 2 commands in, it’s working perfectly, but remotely with bigfix, no result.
Is it a way to use a user like “Network Service” or Something like this ?
Sorry to hear that. I did verify this on one of my lab devices by checking System Restore settings before and after the test, so I do know the actionscript code is correct.
As far as it being a rights issue, BigFix jobs run under the System account by default. So this should be sufficient to make these calls to vssadmin.
If you want to test if this is the issue, you need to open a command prompt as the System user on the device then run the vssadmin commands. If it fails, then yes the System user for some reason can’t run vssadmin on your box. If it succeeds, the System user is not the issue. Please test this out.
You do have some options for running as a different user if you need to. There is the override function where you can specify the user, but I think you may have to be running the latest version of the BigFix client.
You can also use something like psexec, but that definitely can introduce more complexity so I wouldn’t recommend it unless we verify the System account is really not able to execute vssadmin commands.
I was running a CMD.exe with the system account, I’ve tested this with psexec -i -s cmd.exe.
I’ve verified the user with typing “whoami” in the console, result : nt authority\system
I then run the vssadmin resize command, all worked perfectly localy.
So the problem must be Somewhere else.
I’ve tested with psexec and it’s working remotely, but in Big fix I have a lot of Baseline and I wanted to insert this fixlet to modify those shadowstorage.
I will do some research tomorrow to see if I forgot Something to test.
Note - the % character should be fine in raw ActionScript without hex encoding. In a relevance string you would need the hex substitution of %25.
Pingtest worked just fine.
Found this message in c:\shadowtest1.txt and c:\shadowtest2.txt:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Error: A Volume Shadow Copy Service component encountered an unexpected error.
Check the Application event log for more information.
Application Log shows 2 errors for each - most informative is:
Volume Shadow Copy Service error: A critical component required by the Volume Shadow Copy service is not registered. This might happened if an error occurred during Windows setup or during installation of a Shadow Copy provider. The error returned from CoCreateInstance on class with CLSID {0b5a2c52-3eb9-470a-96e2-6c6d4570e40f} and Name Coordinator is [0x80040154, Class not registered
].
Seems like VSSadmin is really unhappy to run from BigFix agent context.
I’ve seen the first error for the first message “shadowtest1.txt” but not the second one.
So, It’s not possible to use Bigfix to do this…
I will do it manually then and If I need to do It remotely, I will use psexec.
Might be possible still, but not unless you can clear the application error. I strongly suspect the security/user context is the issue. If you are on BigFix 9.5.5 or higher, you might try out the new feature to run this as the local administrator? https://developer.bigfix.com/action-script/reference/execution/override.html
I’ve tested the runas feature,
I have a localadmin called “Admnistrateur” who is activated.
When I execute the fixlet, he ask me for the Password of this user. Then the fixlet started
Guys, I tested this again and verified BigFix has no problem running vssadmin just like any other built in exe. Thanks to brolly’s work my actionscript is now even more straightforward:
I had a lab configured to 1% System Restore, ran the fixlet, verified it was now set to 10%, and the vssadmin.log file contents below confirm it ran fine:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.
Successfully resized the shadow copy storage association
There’s really no reason using the default System account via BigFix would be unable to run vssadmin. If you have been testing all this time on the same device, I suggest trying on multiple different devices to see if any of them work.
Btw it’s not working on my laptop and in my actual lab test.
I will try this on a FRESH install. Because I only need to add this in a Baseline for installation of new Computers.
I give you a Feedback when I’m done.
Error: A Volume Shadow Copy Service component encountered an unexpected error.
Check the Application event log for more information.
In my eventlog :
Volume Shadow Copy Service error: A critical component required by the Volume Shadow Copy service is not registered. This might happened if an error occurred during Windows setup or during installation of a Shadow Copy provider. The error returned from CoCreateInstance on class with CLSID {0b5a2c52-3eb9-470a-96e2-6c6d4570e40f} and Name Coordinator is [0x80040154, Class not registered
].
I copy a similiar message because mine is in German or French so not very helpfull for you
Maybe I need Something on my BigFix server(like a component or a service) ? I don’t undestand why it’s working in your Computer and not mine. And why it’s working localy and not remotely with bigfix
Did you tried it on a Windows 32Bits system ??
I’ve tried in a Windows 7 32Bits and it has worked. Now I must find why it’s not working on a 64Bits
I see on the following post : Deployment runs in 32 or 64 under SYSTEM?
that Bigfix run CMD.exe using 32 Bits. I think that’s the case. I will try some tricks and reply after this.
That was the Problem.
I’ve created a Batch file with the following commands :
@echo off
set "SystemPath=%SystemRoot%\System32"
if not "%ProgramFiles(x86)%"=="" (
if exist %SystemRoot%\Sysnative\* set "SystemPath=%SystemRoot%\Sysnative"
)
%SystemPath%\cmd.exe /C vssadmin resize shadowstorage /for=C: /on=C: /maxsize=10%%
%SystemPath%\cmd.exe /C vssadmin resize shadowstorage /for=D: /on=D: /maxsize=10%%
This launch the command with a 64Bits cmd and it’s working perfectly.
I will find a solution to do Something more clean.
One thing of note here is only the first “wait” in this list has the override. You would need to put the override on the second wait as well to have it run as a different user.
‘action uses wow64 redirection false’ has no effect on 32-bit hosts, so it’s safe to run it either way.
I’ve also seen it used as action uses wow64 redirection {not x64 of operating system} but I’m not sure why/whether the architecture check is necessary.