Tag Info

Hot answers tagged

4

PowerShell is a turing-complete scripting language. You can, in theory, write a program in PowerShell to do anything. WMIC is a command-line program for interacting with WMI. By itself, it has no constructs for branching and looping, variable manipulation, or any of the nice things that a programming language has. It's just a tool, basically, for ...


3

wmic product on the local machine. You can also use wmic /NODE:computername get product on remote machines. It will take a while.


3

I want to detect if the disc is a CD, DVD, BD, RW, DL... etc. In Windows GUI under Computer we can see the information according to the icon displayed for the optical drive. You have the right command, the information you seek is under the "Caption" field. So for: wmic cdrom get /format:lis In your example, in the Caption field you can see it is ...


3

Use psloglist from http://technet.microsoft.com/en-us/sysinternals/bb897544.aspx It does exacty what you are asking for.


2

for one citrix has its own deployment technology, secondly are you saying that your deployment method fails in someway? If so I expect it to be an impersonation issue. But I can't really tell from your explanation. the following is a shortcut to all the code that you have 1st copy file.msi \citrixservername\c$\pathtoyourfile wmic /node:citrixservername ...


2

I don't know why WMIC wont work, but the powershell version does work: $cred = get-credential tech1\xxxxx (gwmi -comp 10.162.x.x -cred $cred Win32_OperatingSystem).Shutdown() You'll be prompted for the password, there's no way around it prompting you for the password.


2

It's ye olde Cygwin pty vs native console app issue. Rxvt is based on a "pseudo terminal device" (pty), which Cygwin implements using Windows pipes. Non-Cygwin apps only see the Windows pipes though, which makes some of them think that they should enter non-interactive mode without a prompt. (More specifically, the isatty() function returns false when ...


2

When issuing remote commands, quote the entire string to execute, like: wmic /node:remote_computer process call create "netstat.exe -ano > C:\output.txt"


2

I'd strongly recommend moving away from WMIC.EXE, and use PowerShell instead. PowerShell lets you use RPC to access the remote server's WMI interface, negating the need for PsExec. Although PsExec is a useful tool, I'd only use it if absolutely necessary, as it creates a service on the remote server, the newly created remote service then spawns a process ...


1

Try an echo wmic service where 'caption like "%documentum%"' get name, caption and you can see what's going on. You can also do echo %documentum%. (It should echo the exact command back, including the %documentum%) Maybe you have an environment variable named documentum. (environment variables have precedence over the command parameters. So if they are ...


1

Perhaps split the operation into two scripts. Run the second one automatically after the reboot using a RunOnce key. The first script could automate the setting up of the second.


1

-2147023582 is error 0x80070522, or "A required privilege is not held by the client". I suspect that your script is being run with a limited user token rather than with an Adminsitrator token. You might try the script from an "Administrator" token (i.e. "Run as Administrator", from an Administrator CMD session, etc) and see how it goes. I think you'll find ...


1

You're better off using Powershell's gwmi to more efficiently extract and format the data you want.


1

Depending on the version of Cygwin you are using, you may have to leverage the < /dev/null. I believe I am using 1.7 and I no longer must use < /dev/null on most versions of Windows (the exception is Windows 2003 R2, you still must use < /dev/null.) Here is an example: wmic bios (works on almost all versions of Windows) wmic bios < /dev/null ...


1

NTEVENT WHERE "LogFile='application' AND TimeGenerated > '20100709173000.000000-300'" get message,sourcename /format:csv notice the /format:csv part


1

the 1st one but you need a space between the ipaddress and the /user: add a where clause something like wmic os where "version like '%'" call win32shutdown 2


1

There are many ways to automate (un)installation of MSIs, WMIC being one of them. Have you thought about a simpler approach, like a batch file that does: rem Uninstall old program: msiexec /qb /x {05EC21B8-4593-3037-A781-A6B5AFFCB19D} rem Install new program: msiexec /qb /i MyNewProgram.msi (of course, replacing the GUID above with your program's GUID or ...


1

One way I have gotten past this error is to use runas. If you have access to a command line, then use /runas:<domain>\<domainadmin> cmd.exe. You will get a second command line that runs with domain admin credentials. (Note: to perform on windows 7, you may have to elevate past the UAC.) Once you have your domain admin command line, continue on ...


1

Is it possible you have Windows firewall (or a 3rd party firewall) enabled that is blocking the WMI call? Port 135 needs to be open for WMI to work properly. See this article for details about connecting WMI through a firewall. Edit: I did some more digging about this - you problem is how WMIC uses your credentials when it tries to connect to networkPC. ...



Only top voted, non community-wiki answers of a minimum length are eligible