Click or drag to resize

CommandGetStorePolicies Method

Get storage profile configuration

Namespace:  VMInfoFace.Shell
Assembly:  VMInfoFace.Shell (in VMInfoFace.Shell.dll) Version: 21.5.28.1 (21.5.28.1171)
Syntax
public static List<StoragePolicy> GetStorePolicies(
	string pServer,
	string pUser,
	string pPassword,
	string[] pPowerShellDLLs = null,
	string pVMName = ""
)

Parameters

pServer
Type: SystemString
vSpehre server. Example: 192.162.90.99
pUser
Type: SystemString
VMWare vSphere user name
pPassword
Type: SystemString
VMWare vSphere password
pPowerShellDLLs (Optional)
Type: SystemString
Note Note
Application SOWI VMInfoFace installed the DLLs to GAC.
PowerShell module VMware.PowerCLI DLLs are not installed in the GAC.
Applications that use DLLs search the GAC first.
If the name exists, the system tries to load the corresponding version.
Application SOWI VMInfoFace use VMware vSphere SDK and Microsoft PowerShell module VMware.PowerCLI use same DLLs by name with difference version:
VMware.Binding.WsTrust.dll
VMware.Security.CredentialStore.dll

Default path of installed PowerShell modules: %ProgramFiles%\WindowsPowerShell\Modules

Below code as default DLLs if parameter value null. So can this set optional.

pPowerShellDLLs = new string[]
{
    @"%ProgramFiles%\WindowsPowerShell\Modules\VMware.VimAutomation.Common\11.5.0.14898112\net45\VMware.Binding.WsTrust.dll",
    @"%ProgramFiles%\WindowsPowerShell\Modules\VMware.VimAutomation.Sdk\11.5.0.14898111\net45\VMware.Security.CredentialStore.dll"
};

Or get version of DLLs

//* get version of DLLs *
string lVMWareVimAutomationCommonVersion = VMInfoFace.Shell.Command.GetVersion("VMware.VimAutomation.Common");
string lVMWareVimAutomationSDKVersion = VMInfoFace.Shell.Command.GetVersion("VMware.VimAutomation.Sdk");

pPowerShellDLLs = new string[]
{
    @"%ProgramFiles%\WindowsPowerShell\Modules\VMware.VimAutomation.Common\" + lVMWareVimAutomationCommonVersion + @"\net45\VMware.Binding.WsTrust.dll",
    @"%ProgramFiles%\WindowsPowerShell\Modules\VMware.VimAutomation.Sdk\" + lVMWareVimAutomationSDKVersion + @"\net45\VMware.Security.CredentialStore.dll"
};
pVMName (Optional)
Type: SystemString
VM name an example: ismsrv431044*

Return Value

Type: ListStoragePolicy
Remarks

This command call method GetVersion(String) for DLLs version.

An example of items from PowerShell command Get-SpbmEntityConfiguration
TimeOfCheck      : 23.10.2019 21:47:23
ComplianceStatus : compliant
Entity           : achsrv111040 (CSP NVIDIA License Server / ADFS)
StoragePolicy    : Bronze Storage
ReplicationGroup : 
Name             : achsrv111040 (CSP NVIDIA License Server / ADFS)
Id               : VirtualMachine-vm-62765
Uid              : /VIServer=achermann\sa-devicelistupdater@172.16.99.90:443/SpbmEntityConfiguration=VirtualMachine-vm-62765/


TimeOfCheck      : 23.10.2019 21:47:23
ComplianceStatus : compliant
Entity           : Hard disk 1
StoragePolicy    : Bronze Storage
ReplicationGroup : 
Name             : Hard disk 1
Id               : VirtualMachine-vm-62765/2000
Uid              : /VIServer=achermann\sa-devicelistupdater@172.16.99.90:443/SpbmEntityConfiguration=VirtualMachine-vm-62765&slash;2000/


TimeOfCheck      : 23.10.2019 21:47:23
ComplianceStatus : compliant
Entity           : Hard disk 2
StoragePolicy    : Bronze Storage
ReplicationGroup : 
Name             : Hard disk 2
Id               : VirtualMachine-vm-299/2016
Uid              : /VIServer=achermann\sa-devicelistupdater@172.16.99.90:443/SpbmEntityConfiguration=VirtualMachine-vm-299&slash;2016/

TimeOfCheck      : 23.10.2019 21:47:49
ComplianceStatus : compliant
Entity           : ACHSRV001049 (File/Print)
StoragePolicy    : Bronze Storage
ReplicationGroup : 
Name             : ACHSRV001049 (File/Print)
Id               : VirtualMachine-vm-208
Uid              : /VIServer=achermann\sa-devicelistupdater@172.16.99.90:443/SpbmEntityConfiguration=VirtualMachine-vm-208/


TimeOfCheck      : 23.10.2019 21:47:28
ComplianceStatus : compliant
Entity           : Hard disk 7
StoragePolicy    : Bronze Storage
ReplicationGroup : 
Name             : Hard disk 7
Id               : VirtualMachine-vm-208/2050
Uid              : /VIServer=achermann\sa-devicelistupdater@172.16.99.90:443/SpbmEntityConfiguration=VirtualMachine-vm-208&slash;2050/
See Also