194 questions
Advice
0
votes
1
replies
82
views
Local groups and members using Powershell (Get-WMIobject)
I am trying to replicate a combination of WMI and ADSI, to use just WMI. This is a quick fix whilst we put a case forward for winRM as a replacement. This is something that is new to me, so please ...
0
votes
1
answer
45
views
How can I escape single quotes in a WMI query?
I have the following WMI query:
SELECT PartComponent FROM Win32_GroupUser WHERE GroupComponent = "Win32_Group.Domain='DOMAIN_NAME',Name='Opérateurs d'assistance de contrôle d'accès'"
The ...
1
vote
1
answer
126
views
Why this does not work but similar power shell operation does
I have enabled all needed options using dism
Method:
public object SetKeyStatus(Dictionary<string, string> request)
{
if (!request.ContainsKey("Key") || !...
1
vote
1
answer
60
views
How to develop a C++ decoupled wmi method(not static) provider
I am developing a C++ decoupled WMI provider, but I can only call static methods.
Does anyone know how to call a method from an instance?
PS: the code is based on Windows-classic-samples:
https://...
1
vote
1
answer
58
views
Powershell: Saving output to variable [duplicate]
I want to save an output to a variable, but it saves more characters than I want to save.
I use:
$InstallLocation1 = Get-WmiObject -Class Win32_Product -Filter 'Name like "%FAS%"' | Select ...
1
vote
0
answers
168
views
PowerShell: CimInstance is impossible to remove. ObjectNotFound being raised even though it exists
Scenario
When I run:
Get-CimInstance -Namespace "root/subscription" -Query "Select * from __FilterToConsumerBinding"
...It clearly shows this CimInstance exists:
Consumer ...
1
vote
0
answers
484
views
Getting an error.. Get-wmiObject : access is denied
I am actually fetching some basic system information for a remote desktop by using powershell but i am facing an error..
$remoteComputer = "IP address of the remote computer"
$desktopInfo = ...
1
vote
1
answer
89
views
Basic Powershell question on getting piped values in result
New to Powershell coding here.
Given this means of looking up USB drive letter assignments:
$Foo2 = Get-WMIObject win32_diskdrive | ?{$_.interfacetype -eq "USB"} | %{Get-WMIObject -Query &...
1
vote
0
answers
242
views
Powershell script Get-WmiObject command not run from Task Scheduler
we have "Access Denied" error, when running the PS script from Task Scheduler, but it works fine when running directly from PS shell.
Even we are running command with localhost, we ...
0
votes
1
answer
53
views
Write WMI Output to Reg Key always multiline
Hello I try to get this output to a reg key but it only writes the first "$Monitor.ManufacturerName" value
if I change the Reg_ADD to Multiline_SZ it would work but it has to be a one line ...
0
votes
0
answers
51
views
Get SQL Services details without administrator permissions
Unable to fetch SQL services without administrator permissions
I tried below script to fetch services
Get-Ciminstance -className win32_Service -OperationTimeoutSec 15 -ComputerName ‘xyz’
I got access ...
1
vote
1
answer
4k
views
See Last Login time of domain users in a local computer
Well, I have a hard task of removing users' folders who have not logged for a specific day in computers, we will be doing that in users that have not logged for more than 90 days.
I encountered the ...
3
votes
0
answers
152
views
unable to authenticate credentials on remote windows to get drive details
Below is the PowerShell check_disk_space.ps1 is used to get remote Windows server drives information but instead I get an error:
param ( [string]$passdrives,
[string]$connuser,
[...
0
votes
1
answer
276
views
Powershell: Trying to return specific values from a WMIObject query
I am trying to create a PowerShell script that will pull details about specific software on my computer. To accomplish this, I am trying to use Get-WMIObject. I am able to pull the list of all ...
0
votes
0
answers
124
views
PowerShell variable comparison (like, eq) not working as expected
I'm trying to compare two variables, which store a SHA1 hash.
One of the variables is from a WMIC command and the other is from a get-childitem command.
The WMIC command in question: (Get-WmiObject -...