I asked this question a few days ago, How to connect and remove bluetooth in windows powerhell, but whenever I try running the code: $device = Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth" -and $_.FriendlyName -eq "MX Master 2S"} Disable-PnpDevice -InstanceId $device.InstanceId -Confirm:$false Start-Sleep -Seconds 10 Enable-PnpDevice -InstanceId $device.InstanceId -Confirm:$false I [...] read more
I'm trying to write my first add-in for vs2010, but im struggling. I have a assembly that generates lots of cs files. I want my plugin to add new files to the select project or if the files exist, overwrite them. I'm having 2 problems: 1. When I add a [...] read more
I have a webcam which i want to deactive via powershell script. I have the following line: Get-PnpDevice -FriendlyName 'USB-Videogerät' -Class Camera | Disable-PnpDevice -Confirm:$false But it only works when no program uses the webcam. Is it even possible to deactive a device even though its used by discord or [...] read more
I am unable to update an instance of the ds_computer WMI class within the root\directory\ldap namespace using PowerShell. However I am able to update the same instance using C#. Here is my working C# code: string computerName = Environment.GetEnvironmentVariable("ComputerName"); var connectionOptions = new ConnectionOptions(); connectionOptions.Impersonation = ImpersonationLevel.Impersonate; connectionOptions.Authentication = AuthenticationLevel.PacketPrivacy; [...] read more
When running this PS command as an administrator, I get an error I can't figure out. PS C:\WINDOWS\system32> get-pnpdevice -status UNKNOWN -class 'Monitor' | disable-pnpdevice Confirm Are you sure you want to perform this action? Performing the operation "Disable" on target "Win32_PnPEntity: Generic PnP Monitor (DeviceID = "DISPLAY\NEC6865\4&1919A1B7&0&UID224795")". [Y] Yes [...] read more
I'm implementing a WMI interface in Delphi VCL, I managed to have it working, but I'm now trying to make it a little more robust. The portion of code I'm working on is this: var FWbemServices: ISWbemServices; WMIObject: ISWbemObjectSet; WMISQLQuery: String; FCount: Integer; ... FWbemServices := FWbemLocator.ConnectServer('', 'root\CIMV2', '', '', [...] read more
Consider the following code for COM interop with internet shortcuts: [ComImport] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("CABB0DA0-DA57-11CF-9974-0020AFD79762")] public interface IUniformResourceLocatorW { void SetUrl([MarshalAs(UnmanagedType.LPWStr)] string pcszUrl, int dwInFlags); void GetUrl([MarshalAs(UnmanagedType.LPWStr)] out StringBuilder ppszUrl); void InvokeCommand(IntPtr purlici); } [ComImport] [Guid("FBF23B40-E3F0-101B-8488-00AA003E56F8")] public class InternetShortcut { } The following works as expected: var ishort = new InternetShortcut(); ((IPersistFile)ishort).Load("MyLink.url", [...] read more
I have an application which uses WMI to perform several tasks, one of them is pinging remote machines. For ping I use the following query: SELECT * FROM Win32_PingStatus WHERE Address='192.168.0.1' AND Timeout=3000 AND StatusCode=0 On several systems this works perfectly right. But on some machines this query returns 0x80041001 [...] read more
I'm getting the below message when i try and access SQL Config Manager on my Windows Server 2003 R2 "Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration [...] read more
I'm struggling with a wmi query (running in Administrator Powershell) that is failing with a generic failure... Get-WmiObject -Class win32_pnpdevice results in: Get-WmiObject : Generic failure At line:1 char:14 + Get-WmiObject <<<< -Class win32_pnpdevice + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand This happens on Windows 10 [...] read more
I have sql server v2016 on windows server D V2016 . i can not enable to FileStrem.error Code (0x80041001) Error Image [https://i.stack.imgur.com/Bsdu6.png] New Image [https://i.stack.imgur.com/eW8OQ.png] read more
All day long trying to fix 0x80041001 error, but it's still shows that error. Turning firewall off, UAC off, didn't work. reseting WMI service, trying this, Running as administrator, still nothing changed! It's my code: ManagementScope mgmtScope = new ManagementScope(@"\\.\Root\MicrosoftDNS", new ConnectionOptions() { }); ManagementObjectCollection mgmtDNSRecords = new ManagementObjectSearcher(mgmtScope, new [...] read more
I'm little new to world of WQL (WMI Query Language). I'm trying to query ConfigMgr 2012 using WQL but I'm facing an error when I try to mention the name of a column in the comma separated select clause. The error happens ONLY when the column being fetched is of [...] read more
I'm trying to run the following command on a remote server (Windows Server 2008r2) but it comes up with 0x80041001 Generic failure - I am running CMD in Admin mode and I know the script works as it will run on my local Windows 8 PC. Any advice would be [...] read more
When I ran a VBScript on a windows8.1 machine, I got the following error. Same code ran successfully on other machines. Error: 0x80041001 Code: 80041001 Source: (null) The error line is 'For each ...' Code: 'obtain collection of Windows Installer packages Set MSIapps = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & Computer & "\root\cimv2").ExecQuery("select * [...] read more
Overview: Microsoft Visual Studio is a tool in and of itself. Pun intended. I am trying to use EnvDTE from a System.Windows.Window that is being used as a plugin for Visual Studio. I do not want to access the project from which the plugin was created, rather the currently open [...] read more
I am trying to use a VBScript to query bandwidth usage of my network card. But the query errors out. Set colItems = objWMIService.ExecQuery _ ("select * from Win32_PerfFormattedData_TCPIP_NetworkInterface " ) For Each objItem in colItems WScript.Echo objItem.CurrentBandwidth NEXT I also tried this variation, and it doesn't work either. Set [...] read more
I've upgraded the Windows 10 to 1809 for test purposes and now the SCCM client has the problem that it needs a very long time until it starts and then aborts with the error: Loading Software Center returned error code 0x80041001 (-2147217407). Unfortunately I do not really find much under [...] read more