The ValidatorAPI object can be used to verify the identities of endpoints and profiles is correct, before executing commands using that information.
Method Name |
Parameters |
Description |
EndpointIdentityValidator (string NameOrID) |
NameORID - The endpoint name or ID to be validated. |
Verifies that the name or ID is valid. |
ProfileIdentityValidator (string profileNameOrID |
NameORID - The profile name or ID to be validated. |
Verifies that the name or ID is valid. |
Example:
using Bluethread.SharePoint.StoragePoint;
using Bluethread.SharePoint.StoragePoint.ValidatorAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StoragePointAPI
{
public class ValidatorExamples
{
public static void ValidatorProfile()
{
EndpointIdentityValidator endPointValidator = new EndpointIdentityValidator("EP1");
Guid endPointId;
endPointValidator.IsValidString(out endPointId); // return true and the Guid of Endpoint if it exists inside STP database in other case it throws a exception
}
public static void ValidatorEndpoint()
{
ProfileIdentityValidator profileValidator = new ProfileIdentityValidator("SharePoint-15548");
Guid profileId;
profileValidator.IsValidString(out profileId); // return true and the Guid of Profile if it exists inside STP database in other case it throws a exception
}
public static void ValidatorEndpointNameExample()
{
EndpointIdentityValidator endPointValidator = new EndpointIdentityValidator("EP1");
Guid endpointId;
if (endPointValidator.IsValidString(out endpointId))// return true and the Guid of Endpoint if it exists inside STP database in other case it throws a exception
{
EndpointAPI EP1 = new EndpointAPI(endpointId);
Console.WriteLine(string.Format("Endpoint AdapterName : {0} Connection String :{1} Endpoint Status: {2} , ", EP1.AdapterName.ToString(), EP1.Connection, EP1.Status));
}
}
public static void ValidatorProfileNameExample()
{
ProfileIdentityValidator profileValidator = new ProfileIdentityValidator("SharePoint-15548");
Guid profileId;
if (profileValidator.IsValidString(out profileId))// return true and the Guid of Profile if it exists inside STP database in other case it throws a exception
{
ProfileAPI webbApp_15548 = new ProfileAPI(profileId);
Console.WriteLine(string.Format("Profile Type: {0} Retain Unused BLOBs: {1}", webbApp_15548.Type.ToString(), webbApp_15548.BlobRetentionDays));
}
}
public static void ValidatorEndpointGuidExample()
{
EndpointIdentityValidator endPointValidator = new EndpointIdentityValidator("51F544CA-A32A-4DC4-ADE5-D8BA60DC5638");
Guid endpointId;
if (endPointValidator.IsValidString(out endpointId))// return true and the Guid of Endpoint if it exists inside STP database in other case it throws a exception
{
EndpointAPI endpointInstance = new EndpointAPI(endpointId);
Console.WriteLine(string.Format("Endpoint Name: {0} has Compression: {1}, has Encryption: {2} ", endpointInstance.Name, endpointInstance.UseCompression, endpointInstance.UseEncryption));
}
}
public static void ValidatorProfileGuidExample()
{
ProfileIdentityValidator profileValidator = new ProfileIdentityValidator("4CF245C8-0C4B-4344-A4AB-0578C64C6503");
Guid profileId;
if (profileValidator.IsValidString(out profileId)) // return true and the Guid of Profile if it exists inside STP database in other case it throws a exception
{
ProfileAPI profileInstance = new ProfileAPI(profileId);
string backupEndpoint = profileInstance.BackupEndpoint == null? "None" : profileInstance.BackupEndpoint.Name;
string holdEndpoint = profileInstance.HMOnHoldEndpoint == null? "None" : profileInstance.HMOnHoldEndpoint.Name;
string recordEndpoint = profileInstance.RMDeclaredRecordEndpoint == null ? "None" : profileInstance.RMDeclaredRecordEndpoint.Name;
Console.WriteLine(string.Format("Profile Name: {0}, Profile Scope: {1}, Profile Type: {2}", profileInstance.Name, profileInstance.ScopeId, profileInstance.Type.ToString()));
Console.WriteLine(string.Format("Endpoint Backup: {0}, Endpoint Hold: {1} Endpoint Record: {2}", backupEndpoint, holdEndpoint, recordEndpoint));
foreach (ProfileEndpointAPI profileEndpoint in profileInstance.ProfileEndpoints)
{
Console.WriteLine(string.Format("Endpoint Name: {0}, Endpoint Status: {1}, Endpoint Adapter: {2} , Endpoint Connection string: {3}",
profileEndpoint.Name, profileEndpoint.Status, profileEndpoint.AdapterName, profileEndpoint.Connection));
}
}
}
}
}
The following steps will help you to create a project in Visual Studio and manage the StoragePoint APIs.
Prerequisites
·StoragePoint installed.
·Visual Studio 2013 installed on the WFE where SharePoint is hosted.
·See other prerequisites for each API.
Steps
1.Open Visual Studio.
2.File >Create New Project>C# Console.
3.Go to Project>Add Reference and select BlueThread.SharePoint.StoragePointAPI assembly.
As a result the following reference should be listed
4.Copy the needed code into the c# class
5.Resolve the libraries.
6.Save the changes and run the project.
7.As a result you will have the following results
Do the same with all the commands that are listed in this guide.
Quest creates software solutions that make the benefits of new technology real in an increasingly complex IT landscape. From database and systems management, to Active Directory and Office 365 management, and cyber security resilience, Quest helps customers solve their next IT challenge now. Around the globe, more than 130,000 companies and 95% of the Fortune 500 count on Quest to deliver proactive management and monitoring for the next enterprise initiative, find the next solution for complex Microsoft challenges and stay ahead of the next threat. Quest Software. Where next meets now. For more information, visit www.quest.com.
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center