Start a Conversation

Unsolved

This post is more than 5 years old

P

3223

May 13th, 2011 01:00

Using VBScript and XML API for quota management

I'd like to use the XMP API with VBScript in order to perform some quota reporting and management.  I have viewed an example that was posted (https://community.emc.com/docs/DOC-6372), but as the author mentions "It does not show how to parse XML or do anything with the return", and to be honest, my VBScript knowledge is pretty basic, so I've not figured out how to use XML and VBScript together.

I was hoping that someone could share some examples of how they use the  XML API in VBScript to send and retrieve commands to the control  station?  Would be very helpful if you could, Thank you.

December 21st, 2012 09:00

I know this is old but I just spent some time figuring out the XML API and also started with that same sample script. I used it to see that I could connect to our control station but at that point quickly decided to use Powershell. You can use the same idea and create an Msxml2.ServerXMLHTTP.6.0 object to login and post the xml but you will find the Powershell version much easier to read and easier to deal with all the quotes in xml. Parsing the XML is much easier IMHO.

If this is still something you are interested in or if anyone wants to see my code, let me know. There seems to be one issue with dealing with the XML returned from the control station but I worked around it. Something with the namespaces but I am not XML expert (yet).

39 Posts

January 4th, 2013 05:00

Hi Chris, it's been a while since I posted this, since then I had eventually figured out how to use the Msxml2.ServerXMLHTTP.6.0 object, so I was able to do some basic XML stuff with VBscript, but I would still be interested in any Powershell code that you would be willing to share.

Thanks.

January 4th, 2013 12:00

Hopefully I did this right and you get to: https://community.emc.com/docs/DOC-20865

8.6K Posts

March 14th, 2013 06:00

thanks Chris

Its very helpful to share code examples

2 Posts

August 2nd, 2013 02:00

i'm still trying to get the script against my VNX5300 but i can't succeed. unfortunately, i can't solve the errors of the cert but i think thats not the big issue, but it seems that the scritp isn't running on my site:

Do you have any idea whats wrong ? I'm on 7.1.71.1 code:

PS U:\emc> .\get-nas-cifs-share.ps1 *fs*

Exception calling "send" with "0" argument(s): "The certificate authority is invalid or incorrect

"

At U:\emc\get-nas-cifs-share.ps1:33 char:1

+ $objHTTP.send()

+ ~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ComMethodTargetInvocation

Exception calling "send" with "1" argument(s): "The certificate authority is invalid or incorrect

"

At U:\emc\get-nas-cifs-share.ps1:42 char:1

+ $objHTTP.send($cifsURL)

+ ~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ComMethodTargetInvocation

You cannot call a method on a null-valued expression.

At U:\emc\get-nas-cifs-share.ps1:49 char:1

+ $xml = $response.Replace(" http://www.emc.com/schemas/cel ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At U:\emc\get-nas-cifs-share.ps1:50 char:1

+ $xml = $xml.Replace("", "")

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At U:\emc\get-nas-cifs-share.ps1:53 char:1

+ $shares = $xml.SelectNodes("/Response/CifsShare")

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At U:\emc\get-nas-cifs-share.ps1:56 char:6

+                     $server = $_.SelectNodes("CifsServers/li")."#text"

+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

PS U:\emc>

No Events found!

Top