Get-WmiObject:“Provider not found” (0x80041013) - wmi

Before I'll tell you the problem, I'd like to mention that I'm new to WMI.
In fact, the problem is that when I execute the query "get-wmiobject -namespace root\snmp\SMIR SNMP_JVM_MANAGEMENT_MIB_jvmMemory"
from PowerShell, I get this error “Provider not found” (error number "0x80041013").
But even when using other classes belonging to the namespace "root\snmp\SMIR" , the same error occurs.
I tried to google the issue and I found a Microsoft Link (https://technet.microsoft.com/en-us/library/ff406382.aspx#H27) which describes some steps I must follow,
yet when I tried these steps and even when i rebuild the Wmi Repository, the error persists as well.
Please i need your help!
Thanks in advance

Check which namespaces you have available.
get-wmiobject -namespace "root" -class "__Namespace" | Select Name
Is the namespace you are looking for in this list?
Have you tried any other namespaces?
Like for example.
get-wmiobject -namespace root\cimv2 -list
Try get-wmiobject -class win32_bios
Do you get the same error?

Related

Powershell: Export List of apps

I wanted a hands off approach to get a list of all the applications installed on a system.
A search brought me to many websites that utilized Get-ItemProperty like on this page here
I quickly found that I could export the list to txt file for easy access at a later time.
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\username\Documents\InstalledPrograms-PS.txt
*username is a place holder
What I found, however, is that I could run this when pasting it directly into powershell, but when placing this into a script, it would crash or not run at all.
I'm assuming I'm missing something and a straight copy and paste will not work.
Any help would be appreciated.
NOTE: I'm sure someone is bound to recommend WMIC, but this does not seem to list all the apps.
Update:
Seems that within my script
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
on its own works just fine. It's when the formatting happens that it crashes.
Solution:
For anyone looking to get an easy and quick way to get a list of all applications, including microsoft store ones, here's what I did. I just have them export to a .txt file to keep for later.
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table > c:\applist.txt
Microsoft Store Apps
Get-AppxPackage | Select Name, PackageFullName |Format-Table -AutoSize > c:\microsoftlist.txt
It worked for me, although emacs said the '-' before AutoSize was a foreign character. \226
It may be unicode en dash, 8211 decimal: https://www.fileformat.info/info/unicode/char/2013/index.htm A regular dash would be 45.
[int][char]'–'
8211
By the way, there's also get-package to list installed applications.

CSOM Equivalent of allusers

Can anyone tell me if there is an Equivalent of allusers in sharepoint csom. I cant seem to find anything. Basically im creating a remote event receiver and im trying to replace the following piece of code with the CSOM equivalent
properties.Web.AllUsers.GetByID(properties.GroupUserId)
Can't believe this wasn't answered!
The following should work:
https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.client.web.siteusers.aspx
https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.client.usercollection.getbyid.aspx

Change Wix Product version number using NANT XmlPoke

I ran into this issue recently - when I try to replace the Wix Product version number using NANT XMLPOKE task, it returns the following error message "No matching nodes found".
<xmlpoke file="..\Setup\abc.wxs" xpath="//Wix/Product[#Version]" value="${version.label}" >
Initially I thought that this was an issue with XPATH statement that I wrote. So I kept trying with different XPATH (like \Wix) and I kept getting the same message back.
Understood from a blog that this is happening due to the namespace definition with the WiX element. Please find below the solution, in case someone doesn't find the blog.
The issue happens because of the namespace definition within the Wix element. You have to add the below changes to get the XMLPOKE working:
<xmlpoke file="..\Setup\abc.wxs" xpath="//wx:Wix/wx:Product/#Version" value="${version.label}" >
<namespaces>
<namespace prefix="wx" uri="http://schemas.microsoft.com/wix/2006/wi" />
</namespaces>
</xmlpoke>
Reference: Soledad Pano's blog

oscommerce echo osc_link_object(osc_href_link problem

In oscommerce, I have set the DIR_WS_IMAGES from the config.php to be an external url so that the site loads the images from a static cookie-less subdomain.
The images work fine except the pop-us.
The pop-up scritp echo osc_link_object(osc_href_link(DIR_WS_IMAGES. will give the following url http://www.example.com/http://subdomain.example.com/products/originals/image.jpg which will not function as its calling main url plus the DIR_WS_IMAGES url.
How can I amend the script to just call subdomain.excample.com
Thanks for any help.
Regs Fabian
This is the code that is giving a double url [http://www.example.com/http://subdomain.example.com] that needs to be corrected to output just the [http://subdomian.example.com]
<?php
$group_id = $osC_Image->getID('originals');
echo osc_link_object(osc_href_link(DIR_WS_IMAGES.'products/'.$osC_Image->getCode($group_id).'/'.$osC_Product->getImage(),null,'AUTO',false), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle(), null, 'product_info'), 'target="_blank" rel=""');?>
Appreciate all the help.
Regs Fab
Quickest and easiest thing to do (and won't look so out of place in osCommerce's code) is to do a preg_replace().
echo str_replace('/^http:\/\/www\.example\.com\//', '', osc_link_object(osc_href_link(DIR_WS_IMAGES.'whatever.jpg')));
Even better, dig out the global constant from includes/config.php and concatenate it in the regex - be sure to use preg_quote(SITE_BASE, '/') (assuming SITE_BASE is it, can't think of it right now off the top of my head).
May be this post can help you a bit.
http://developerblog.e-cart-solutions.com/2010/10/product-images-images-from-remote-locations/
You can simply restort to replacing the domainname by the sudomain name if the paths are no different using a simple str_replace.
Shiva
I have managed to correct the problem by simply doing
osc_link_object($link = DIR_WS_IMAGES.('products/'....
instead of
echo osc_link_object(osc_href_link(DIR_WS_IMAGES.'products/'....
Thanks to all does that offered help.
With best regards
Fabian

Why don't any functions run from the Doctrine 2.0 Command Line Interface (CLI)?

I've recently managed to get the betas of Codeigniter 2.0 and Doctrine 2.0 working together, thanks to the help from this guide: http://eryr.wordpress.com/2010/09/26/integrating-doctrine-2-with-codeigniter-2/
I have set up the CLI as set out in that guide, but I can't run any commands - I type doctrine and get the menu and list of commands, but then when I type a command like doctrine orm:schema-tool:create it just loads the same screen again with the list of commands. I don't get any error messages or anything.
My application/doctrine.php: http://pastebin.com/P0CtefhF
My application/cli-config.php: http://pastebin.com/KCVfZFct
If anyone can even give me a clue or point me in the right direction I would be most grateful. I have been trying to get my head around this for a day and a half now :S
Hey, I just got this all working together myself.
One thing, it depends on how you DL'd doctrine to begin with. I DL'd directly, no SVN or GIT in other words.
I ended putting my cli-config.php, doctrine.php and Doctrine.php in "application/tools" dir. "tools" is a dir I just created. It did not exist before.
The current way it's set up with the examples from that link you gave, I think they all need to be in "application/libraries", so if you want to move them to "application/tools" you need to update those paths.
So for example:
require_once CURPATH.'/../config/database.php';
This is saying to go up from 'application\tools' to 'application\config' and get that 'database.php' file.
require_once CURPATH.'/../libraries/Doctrine/Common/ClassLoader.php';
And This is doing the same, except that it is going into "application\libraries\Doctrine\Common" and looking for "ClassLoader.php"
Does that help?
Anyone having this trouble should try two things:
First of all instead of just typing doctrine command make sure you type php doctrine.php command.
Also make sure you have adjusted your system path correctly instead of your user account path.
Once I did both of those things it worked for me fine. Bit confusing though as the first command does work to bring up the list of possibilities, but not when you run any actual command.