Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtendWebApplication"/> class.
        /// </summary>
        public ExtendWebApplication()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator()));
            parameters.Add(new SPParam("vsname", "vsname", true, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("allowanonymous", "anon"));
            parameters.Add(new SPParam("exclusivelyusentlm", "ntlm"));
            parameters.Add(new SPParam("usessl", "ssl"));
            parameters.Add(new SPParam("hostheader", "hostheader", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("port", "p", false, "80", new SPIntRangeValidator(0, int.MaxValue)));
            parameters.Add(new SPParam("path", "path", true, null, new SPNonEmptyValidator()));
            SPEnumValidator zoneValidator = new SPEnumValidator(typeof(SPUrlZone));

            parameters.Add(new SPParam("zone", "zone", false, SPUrlZone.Custom.ToString(), zoneValidator));
            parameters.Add(new SPParam("loadbalancedurl", "lburl", true, null, new SPUrlValidator()));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nExtends a web application onto another IIS web site.  This allows you to serve the same content on another port or to a different audience\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <url of the web application to extend>");
            sb.Append("\r\n\t-vsname <web application name>");
            sb.Append("\r\n\t-path <path>");
            sb.Append("\r\n\t-loadbalancedurl <the load balanced URL is the domain name for all sites users will access in this SharePoint Web application>");
            sb.AppendFormat("\r\n\t[-zone <{0} (defaults to Custom)>]", zoneValidator.DisplayValue);
            sb.Append("\r\n\t[-port <port number (default is 80)>]");
            sb.Append("\r\n\t[-hostheader <host header>]");
            sb.Append("\r\n\t[-exclusivelyusentlm]");
            sb.Append("\r\n\t[-allowanonymous]");
            sb.Append("\r\n\t[-usessl]");

            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CopyContentTypes"/> class.
        /// </summary>
        public ExportContentTypes()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the source site collection."));
            parameters.Add(new SPParam("name", "n", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("group", "g", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("listname", "list", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("outputfile", "output", false, null, new SPDirectoryExistsAndValidFileNameValidator()));
            parameters.Add(new SPParam("includelistbindings", "ilb"));
            parameters.Add(new SPParam("includefielddefinitions", "ifd"));
            parameters.Add(new SPParam("excludeparentfields", "epf"));
            parameters.Add(new SPParam("removeencodedspaces", "res"));
            parameters.Add(new SPParam("featuresafe", "safe"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nExports Content Types to an XML file.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <url containing the content types>");
            sb.Append("\r\n\t-outputfile <file to output results to>");
            sb.Append("\r\n\t[-name <name of an individual content type to export>]");
            sb.Append("\r\n\t[-group <content type group name to filter results by>]");
            sb.Append("\r\n\t[-listname <name of a list to export content types from>]");
            sb.Append("\r\n\t[-includelistbindings]");
            sb.Append("\r\n\t[-includefielddefinitions]");
            sb.Append("\r\n\t[-excludeparentfields]");
            sb.Append("\r\n\t[-removeencodedspaces (removes '_x0020_' in field names)]");
            sb.Append("\r\n\t[-featuresafe]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CopyContentTypes"/> class.
        /// </summary>
        public CopyContentTypes()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("sourceurl", "sourceurl", true, null, new SPUrlValidator(), "Please specify the source site collection."));
            parameters.Add(new SPParam("targeturl", "targeturl", true, null, new SPUrlValidator(), "Please specify the target site collection"));
            parameters.Add(new SPParam("sourcename", "sourcename", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("noworkflows", "noworkflows", false, null, null));
            parameters.Add(new SPParam("nocolumns", "nocolumns", false, null, null));
            parameters.Add(new SPParam("nodocconversions", "nodocconversions", false, null, null));
            parameters.Add(new SPParam("nodocinfopanel", "nodocinfopanel", false, null, null));
            parameters.Add(new SPParam("nopolicies", "nopolicies", false, null, null));
            parameters.Add(new SPParam("nodoctemplate", "nodoctemplate", false, null, null));
            parameters.Add(new SPParam("verbose", "v"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nCopies all Content Types from one gallery to another.\r\n\r\nParameters:");
            sb.Append("\r\n\t-sourceurl <site collection url containing the source content types>");
            sb.Append("\r\n\t-targeturl <site collection url where the content types will be copied to>");
            sb.Append(
                "\r\n\t[-sourcename <name of an individual content type to copy - if ommitted all content types are copied if they don't already exist>]");
            sb.Append("\r\n\t[-noworkflows]");
            sb.Append("\r\n\t[-nocolumns]");
            sb.Append("\r\n\t[-nodocconversions]");
            sb.Append("\r\n\t[-nodocinfopanel]");
            sb.Append("\r\n\t[-nopolicies]");
            sb.Append("\r\n\t[-nodoctemplate]");
            sb.Append("\r\n\t[-verbose]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReplaceWebPartContent"/> class.
        /// </summary>
        public ReplaceWebPartContent()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", false, null, new SPNonEmptyValidator(), "Please specify the url to search."));
            parameters.Add(new SPParam("searchstring", "search", true, null, new SPNonEmptyValidator(), "Please specify the search string."));
            parameters.Add(new SPParam("replacestring", "replace", true, null, new SPNullOrNonEmptyValidator(), "Please specify the search string."));
            parameters.Add(new SPParam("scope", "scope", true, null, new SPRegexValidator("(?i:^Farm$|^WebApplication$|^Site$|^Web$|^Page$)")));
            parameters.Add(new SPParam("webpartname", "part", false, null, new SPNonEmptyValidator(), "Please enter the web part name."));
            parameters.Add(new SPParam("quiet", "q", false, null, null));
            parameters.Add(new SPParam("test", "t", false, null, null));
            parameters.Add(new SPParam("publish", "p", false, null, null));
            parameters.Add(new SPParam("logfile", "log", false, null, new SPDirectoryExistsAndValidFileNameValidator()));
            parameters.Add(new SPParam("unsafexml", "unsafexml"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nReplaces all occurances of the search string with the replacement string.  Supports use of regular expressions.  Use -test to verify your replacements before executing.\r\n\r\nParameters:");
            sb.Append("\r\n\t[-url <url to search>]");
            sb.Append("\r\n\t-searchstring <regular expression string to search for>");
            sb.Append("\r\n\t-replacestring <replacement string>");
            sb.Append("\r\n\t-scope <Farm | WebApplication | Site | Web | Page>");
            sb.Append("\r\n\t[-webpartname <web part name>]");
            sb.Append("\r\n\t[-quiet]");
            sb.Append("\r\n\t[-test]");
            sb.Append("\r\n\t[-logfile <log file>]");
            sb.Append("\r\n\t[-publish]");
            sb.Append("\r\n\t[-unsafexml (treats known XML data as a string)]");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EnumUnGhostedFiles"/> class.
        /// </summary>
        public EnumUnGhostedFiles()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the site url."));
            parameters.Add(new SPParam("recursesubwebs", "recurse", false, null, null));
            Init(parameters, "\r\n\r\nReturns a list of all unghosted (customized) files for a web.\r\n\r\nParameters:\r\n\t-url <web site url>\r\n\t[-recursesubwebs]");
        }
        public SPExportPersonalView()
            : base()
        {
            SPParamCollection @params = new SPParamCollection();

            @params.Add(new SPParam("url", "url", true, null, new SPNonEmptyValidator()));
            @params.Add(new SPParam("filePath", "file", true, null, new SPNonEmptyValidator()));
            base.Init(@params, Usage.Export);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UpdateV2ToV3UpgradeAreaUrlMappings"/> class.
        /// </summary>
        public UpdateV2ToV3UpgradeAreaUrlMappings()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("webapp", "w", true, null, new SPUrlValidator(), "Please specify the upgraded web application."));
            parameters.Add(new SPParam("sourceurl", "s", true, null, new SPNonEmptyValidator(), "Please specify the source url."));
            parameters.Add(new SPParam("targeturl", "t", true, null, new SPNonEmptyValidator(), "Please specify the target url."));
            Init(parameters, "\r\n\r\nUpdates the server relative URL corresponding to the source URL to reflect the new target URL in the Upgrade Area URL Mappings list: \"http://[portal]/Lists/98d3057cd9024c27b2007643c1/AllItems.aspx\".  All sites below the site are also updated.\r\n\r\nParameters:\r\n\t-webapp <web application>\r\n\t-sourceurl <source V3 url (this is not the V2 bucket URL)>\r\n\t-targeturl <target V3 URL>");
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FixPublishingPagesPageLayoutUrl"/> class.
        /// </summary>
        public FixPublishingPagesPageLayoutUrl()
        {
            SPParamCollection parameters = new SPParamCollection();
            StringBuilder     sb         = new StringBuilder();

#if MOSS
            parameters.Add(new SPParam("url", "url", false, null, new SPNonEmptyValidator(), "Please specify the url to search."));
            parameters.Add(new SPParam("scope", "scope", true, null, new SPRegexValidator("(?i:^WebApplication$|^Site$|^Web$|^Page$)")));
            parameters.Add(new SPParam("pagelayout", "layout", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("regexsearchstring", "search", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("regexreplacestring", "replace", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("pagename", "page", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("verbose", "v"));
            parameters.Add(new SPParam("fixcontact", "fixcontact"));
            parameters.Add(new SPParam("test", "t"));


            sb.Append("\r\n\r\nFixes the Page Layout URL property of publishing pages which can get messed up during an upgrade or from importing into a new farm.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <url>");
            sb.Append("\r\n\t-scope <WebApplication | Site | Web | Page>");
            sb.Append("\r\n\t[-pagename <if scope is Page, the name of the page to update>]");
            sb.Append("\r\n\t{[-pagelayout <url of page layout to retarget page(s) to (format: \"url, desc\")>] /");
            sb.Append("\r\n\t [-regexsearchstring <search pattern to use for a regular expression replacement of the page layout url>]");
            sb.Append("\r\n\t [-regexreplacestring <replace pattern to use for a regular expression replacement of the page layout url>]}");
            sb.Append("\r\n\t[-fixcontact]");
            sb.Append("\r\n\t[-verbose]");
            sb.Append("\r\n\t[-test]");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif
            Init(parameters, sb.ToString());
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateContentDB"/> class.
        /// </summary>
        public CreateContentDB()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("dbname", "db", true, null, new SPNonEmptyValidator(), "Please specify the database name."));
            parameters.Add(new SPParam("dbserver", "server", false, null, new SPNonEmptyValidator(), "Please specify the database server."));
            parameters.Add(new SPParam("webapp", "web", true, null, new SPUrlValidator(), "Please specify the web application."));
            parameters.Add(new SPParam("maxsites", "max", false, "15000", new SPIntRangeValidator(0, Int32.MaxValue)));
            parameters.Add(new SPParam("warningsitecount", "warn", false, "9000", new SPIntRangeValidator(0, Int32.MaxValue)));
            parameters.Add(new SPParam("searchserver", "search", false, null, new SPNullOrNonEmptyValidator()));
            parameters.Add(new SPParam("dbuser", "dbuser", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("dbpwd", "dbpwd", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("status", "s", false, "online", new SPRegexValidator("^online$|^disabled$")));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nCreates a new content database.\r\n\r\nParameters:");
            sb.Append("\r\n\t-dbname <content database name>");
            sb.Append("\r\n\t-webapp <web application url>");
            sb.Append("\r\n\t[-dbserver <content database server>]");
            sb.Append("\r\n\t[-maxsites <maximum number of sites allowed in the db (default is 15000)>]");
            sb.Append("\r\n\t[-warningsitecount <number of sites before a warning event is generated (default is 9000)>]");
            sb.Append("\r\n\t[-searchserver <search server (leave empty to clear the search server)>]");
            sb.Append("\r\n\t[-dbuser <database username (if using SQL Authentication and not Windows Authentication)>]");
            sb.Append("\r\n\t[-dbpwd <database password (if using SQL Authentication and not Windows Authentication)>]");
            sb.Append("\r\n\t[-status <online | disabled>]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateAudience"/> class.
        /// </summary>
        public CreateAudience()
        {
            SPParamCollection parameters = new SPParamCollection();
            StringBuilder     sb         = new StringBuilder();

#if MOSS
            SPEnumValidator ruleValidator = new SPEnumValidator(typeof(RuleEnum));

            parameters.Add(new SPParam("name", "n", true, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("serviceappname", "app", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("sitesubscriptionid", "subid", false, Guid.Empty.ToString(), new SPGuidValidator()));
            parameters.Add(new SPParam("contextsite", "site", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("description", "desc", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("owner", "owner", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("update", "u"));
            parameters.Add(new SPParam("rule", "r", false, "none", ruleValidator));

            sb.Append("\r\n\r\nCreates an audience.\r\n\r\nParameters:");
            sb.Append("\r\n\t-name <audience name>");
            sb.Append("\r\n\t[-serviceappname <user profile service application name>]");
            sb.Append("\r\n\t[-sitesubscriptionid <GUID>]");
            sb.Append("\r\n\t[-contextsite <URL of the site to use for service context>]");
            sb.Append("\r\n\t[-description <audience description>]");
            sb.Append("\r\n\t[-owner <DOMAIN\\user>]");
            sb.AppendFormat("\r\n\t[-rule <{0}> (default is none)]", ruleValidator.DisplayValue);
            sb.Append("\r\n\t[-update (if the audience exists, update it)]");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RetargetContentQueryWebPart"/> class.
        /// </summary>
        public RetargetContentQueryWebPart()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPNonEmptyValidator(), "Please specify the page url."));
            parameters.Add(new SPParam("id", "id", false, null, new SPNonEmptyValidator(), "Please specify the web part ID."));
            parameters.Add(new SPParam("title", "t", false, null, new SPNonEmptyValidator(), "Please specify the web part title."));
            parameters.Add(new SPParam("list", "l", false, null, new SPNonEmptyValidator(), "Please specify the list view URL."));
            parameters.Add(new SPParam("listtype", "type", false, null, new SPNonEmptyValidator(), "Please specify the list type."));
            parameters.Add(new SPParam("site", "s", false, null, new SPUrlValidator(), "Please specify the site to show items from."));
            parameters.Add(new SPParam("allmatching", "all", false, null, null));
            parameters.Add(new SPParam("publish", "p", false, null, null));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nRetargets a Content Query web part (do not provide list or site if you wish to show items from all sites in the containing site collection).\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web part page URL>");
            sb.Append("\r\n\t{-id <web part ID> |\r\n\t -title <web part title>}");
            sb.Append("\r\n\t[-list <list view URL>]");
            sb.Append("\r\n\t[-listtype <list type (template) to show items from>]");
            sb.Append("\r\n\t[-site <show items from this site and all subsites>]");
            sb.Append("\r\n\t[-allmatching (if title specified and more than one match found, adjust all matches)");
            sb.Append("\r\n\t[-publish]");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddListViewWebPart"/> class.
        /// </summary>
        public AddListViewWebPart()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the page url."));
            parameters.Add(new SPParam("listurl", "lu", true, null, new SPUrlValidator(), "Please specify the page url."));
            parameters.Add(new SPParam("title", "t", false, null, new SPNonEmptyValidator(), "Please specify the web part title."));
            parameters.Add(new SPParam("viewtitle", "v", false, null, new SPNonEmptyValidator(), "Please specify the name of the view to use."));
            parameters.Add(new SPParam("zone", "z", true, null, new SPNonEmptyValidator(), "Please specify the zone to add the web part to."));
            parameters.Add(new SPParam("zoneindex", "zi", true, null, new SPIntRangeValidator(0, int.MaxValue)));
            parameters.Add(new SPParam("linktitle", "lt", false, null, null));
            parameters.Add(new SPParam("publish", "p", false, null, null));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nAdds a list view web part to a page.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web part page URL>");
            sb.Append("\r\n\t-listurl <list url>");
            sb.Append("\r\n\t-viewtitle <view title>");
            sb.Append("\r\n\t-zone <zone ID>");
            sb.Append("\r\n\t-zoneindex <zone index>");
            sb.Append("\r\n\t[-title <web part title>]");
            sb.Append("\r\n\t[-linktitle]");
            sb.Append("\r\n\t[-publish]");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SetPictureUrl"/> class.
        /// </summary>
        public SetPictureUrl()
        {
            SPParamCollection parameters = new SPParamCollection();

#if MOSS
            parameters.Add(new SPParam("path", "p", true, null, new SPNullOrNonEmptyValidator(), "Please specify the path."));
            parameters.Add(new SPParam("serviceappname", "app", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("sitesubscriptionid", "subid", false, Guid.Empty.ToString(), new SPGuidValidator()));
            parameters.Add(new SPParam("contextsite", "site", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("username", "u", false, null, new SPNonEmptyValidator(), "Please specify the username."));
            parameters.Add(new SPParam("overwrite", "ow"));
            parameters.Add(new SPParam("ignoremissingdata", "ignore"));
            parameters.Add(new SPParam("validateurl", "validate"));

            StringBuilder sb = new StringBuilder();
            sb.Append("\r\n\r\nSets the picture URL path for user profiles.  The following variables may be used for dynamic replacement: \"$(username)\", \"$(domain)\", \"$(email)\", \"$(firstname)\", \"$(lastname)\", \"$(employeeid)\".\r\n\r\nParameters:");
            sb.Append("\r\n\t-path <path to new photo (i.e., \"http://intranet/hr/EmployeePictures/$(username).jpg\") - leave blank to clear>");
            sb.Append("\r\n\t[-serviceappname <user profile service application name>]");
            sb.Append("\r\n\t[-sitesubscriptionid <GUID>]");
            sb.Append("\r\n\t[-contextsite <URL of the site to use for service context>]");
            sb.Append("\r\n\t[-username <DOMAIN\\name>]");
            sb.Append("\r\n\t[-overwrite]");
            sb.Append("\r\n\t[-ignoremissingdata]");
            sb.Append("\r\n\t[-validateurl]");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddEventReceiver"/> class.
        /// </summary>
        public AddEventReceiver()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the URL to the web or list."));
            parameters.Add(new SPParam("assembly", "a", true, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("class", "c", true, null, new SPNonEmptyValidator()));
            SPEnumValidator typeValidator = new SPEnumValidator(typeof(SPEventReceiverType));

            parameters.Add(new SPParam("type", "type", true, null, typeValidator));
            SPEnumValidator targetValidator = new SPEnumValidator(typeof(Common.Lists.AddEventReceiver.TargetEnum));

            parameters.Add(new SPParam("target", "target", false, "list", targetValidator));
            parameters.Add(new SPParam("contenttype", "ct", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("sequence", "seq", false, null, new SPIntRangeValidator(0, int.MaxValue)));
            parameters.Add(new SPParam("name", "n", false, null, new SPNonEmptyValidator()));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nAdds an event receiver to a list, web, or content type.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web or list URL>");
            sb.Append("\r\n\t-assembly <assembly>");
            sb.Append("\r\n\t-class <class name>");
            sb.AppendFormat("\r\n\t-type <{0}>", typeValidator.DisplayValue);
            sb.AppendFormat("\r\n\t-target <{0}>", targetValidator.DisplayValue);
            sb.Append("\r\n\t[-contenttype <content type name if target is ContentType>]");
            sb.Append("\r\n\t[-sequence <sequence number>]");
            sb.Append("\r\n\t[-name <the name to give to the event receiver>]");
            Init(parameters, sb.ToString());
        }
        public RepairSiteCollectionImportedFromSubSite()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("sourceurl", "source", true, null, new SPUrlValidator(), "Please specify the source sub-site or model site collection."));
            parameters.Add(new SPParam("targeturl", "target", true, null, new SPUrlValidator(), "Please specify the target location of the new site collection to repair."));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nRepairs a site collection that has been imported from an exported sub-site.  Note that the sourceurl can be the actual source site or any site collection that can be used as a model for the target.\r\n\r\nParameters:");
            sb.Append("\r\n\t-sourceurl <source location of the existing sub-site or model site collection>");
            sb.Append("\r\n\t-targeturl <target location for the new site collection>");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EnumPageWebParts"/> class.
        /// </summary>
        public EnumPageWebParts()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPNonEmptyValidator(), "Please specify the page url."));
            parameters.Add(new SPParam("verbose", "v", false, null, null));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nLists all the web parts that have been added to the specified page.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web part page URL>");
            sb.Append("\r\n\t[-verbose]");

            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SetSelfServiceSiteCreation"/> class.
        /// </summary>
        public SetSelfServiceSiteCreation()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the web application url."));
            parameters.Add(new SPParam("enabled", "e", false, null, new SPTrueFalseValidator(), "Please specify \"true\" or \"false\" for enabled."));
            parameters.Add(new SPParam("requiresecondarycontact", "r", false, null, new SPTrueFalseValidator(), "Please specify \"true\" or \"false\" for requiresecondarycontact."));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nSets whether self service site creation is enabled for the web application.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web application>");
            sb.Append("\r\n\t[-enabled <true|false>]");
            sb.Append("\r\n\t[-requiresecondarycontact <true|false>]");
            Init(parameters, sb.ToString());
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateQuotaTemplate"/> class.
        /// </summary>
        public CreateQuotaTemplate()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("name", "n", true, null, new SPNonEmptyValidator(), "Please specify the quota template name."));
            parameters.Add(new SPParam("storagemaxlevel", "max", false, null, new SPLongRangeValidator(0, (long.MaxValue / 1024) / 1024), "Please specify the maximum storage level."));
            parameters.Add(new SPParam("storagewarninglevel", "warn", false, null, new SPLongRangeValidator(0, (long.MaxValue / 1024) / 1024), "Please specify the level at which a warning email should be sent."));

            StringBuilder sb = new StringBuilder();

            sb.Append("\n\r\n\r\nCreates a new quota template\r\n\r\nParameters:");
            sb.Append("\r\n\t-name <quota name>");
            sb.Append("\r\n\t[-storagemaxlevel <maximum storage level in megabytes>]");
            sb.Append("\r\n\t[-storagewarninglevel <warning level in megabytes>]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EnumEffectiveBasePerms"/> class.
        /// </summary>
        public EnumEffectiveBasePerms()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the site collection."));
            parameters.Add(new SPParam("user", "user", false, null, new SPNonEmptyValidator(), "Please specify the username."));
            parameters.Add(new SPParam("invert", "i", false, null, null));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nLists the effective base permissions for a user.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <web url>");
            sb.Append("\r\n\t[-user <DOMAIN\\name>]");
            sb.Append("\r\n\t[-invert (shows what base permissions the user is missing)]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteWebApp"/> class.
        /// </summary>
        public DeleteWebApp()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator()));
            parameters.Add(new SPParam("deleteiiswebsite", "iis"));
            parameters.Add(new SPParam("deletecontentdb", "db"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nDeletes a web application.\r\n\r\nParameters:\r\n");
            sb.Append("\t-url <url>\r\n");
            sb.Append("\t[-deleteiiswebsite]\r\n");
            sb.Append("\t[-deletecontentdb]\r\n");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ListAudienceTargeting"/> class.
        /// </summary>
        public ListAudienceTargeting()
        {
            SPParamCollection parameters = new SPParamCollection();
            StringBuilder     sb         = new StringBuilder();

#if MOSS
            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the list view URL."));
            parameters.Add(new SPParam("enabled", "e", true, null, new SPTrueFalseValidator()));

            sb.Append("\r\n\r\nEnabling audience targeting will create a targeting column for the list. Web parts, such as the Content Query Web Part, can use this data to filter list contents based on the user's context.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <list view url>");
            sb.Append("\r\n\t-enabled <true|false>");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteListField"/> class.
        /// </summary>
        public DeleteListField()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the list view URL."));
            parameters.Add(new SPParam("fielddisplayname", "title", false, null, new SPNonEmptyValidator(), "Please specify the field's display name to delete."));
            parameters.Add(new SPParam("fieldinternalname", "name", false, null, new SPNonEmptyValidator(), "Please specify the field's internal name to delete."));
            parameters.Add(new SPParam("force", "force", false, null, null));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nDeletes a field (column) from a list.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <list view URL>");
            sb.Append("\r\n\t-fielddisplayname <field display name> / -fieldinternalname <field internal name>");
            sb.Append("\r\n\t[-force (used to force deletion if AllowDeletion property is false)]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SetBackConnectionHostNames"/> class.
        /// </summary>
        public SetBackConnectionHostNames()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("updatefarm", "uf"));
            parameters.Add(new SPParam("username", "user", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("password", "pwd", false, null, new SPNullOrNonEmptyValidator()));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nSets the BackConnectionHostNames registry key with the URLs associated with each web application.\r\n\r\nParameters:");
            sb.Append("\r\n\t[-updatefarm (update all servers in the farm)]");
            sb.Append("\r\n\t[-username <DOMAIN\\user (must have rights to update the registry on each server)>]");
            sb.Append("\r\n\t[-password <password>]");

            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplyTheme"/> class.
        /// </summary>
        public ApplyTheme()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator()));
            parameters.Add(new SPParam("theme", "theme", true, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("recurse", "r"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nApplies the specified theme to the specified site.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <url of the web to update>");

            sb.AppendFormat("\r\n\t-theme <id of the theme to apply (see {0}\\Layouts\\[LCID]\\SPThemes.xml for template IDs>", Utilities.GetGenericSetupPath("Template"));
            sb.Append("\r\n\t[-recurse (applies change to all sub-webs)]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportAudiences"/> class.
        /// </summary>
        public ImportAudiences()
        {
            SPParamCollection parameters = new SPParamCollection();
            StringBuilder     sb         = new StringBuilder();

#if MOSS
            parameters.Add(new SPParam("serviceappname", "app", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("sitesubscriptionid", "subid", false, Guid.Empty.ToString(), new SPGuidValidator()));
            parameters.Add(new SPParam("contextsite", "site", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("deleteexisting", "delete"));
            parameters.Add(new SPParam("inputfile", "input", false, null, new SPFileExistsValidator()));
            parameters.Add(new SPParam("compile", "c"));
            parameters.Add(new SPParam("mapfile", "map", false, null, new SPDirectoryExistsAndValidFileNameValidator()));

            sb.Append("\r\n\r\nImports all audiences given the provided input file.\r\n\r\nParameters:");
            sb.Append("\r\n\t-inputfile <file to input results from>");
            sb.Append("\r\n\t[-deleteexisting <delete existing audiences>]");
            sb.Append("\r\n\t[-serviceappname <user profile service application name>]");
            sb.Append("\r\n\t[-sitesubscriptionid <GUID>]");
            sb.Append("\r\n\t[-contextsite <URL of the site to use for service context>]");
            sb.Append("\r\n\t[-compile]");
            sb.Append("\r\n\t[-mapfile <generate a map file to use for search and replace of Audience IDs>]");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeactivateFeature"/> class.
        /// </summary>
        public DeactivateFeature()
        {
            SPEnumValidator scopeValidator = new SPEnumValidator(typeof(ActivationScope));

            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("filename", "f", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("name", "n", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("id", "id", false, null, new SPGuidValidator()));
            parameters.Add(new SPParam("url", "url", false, null, new SPUrlValidator()));
            parameters.Add(new SPParam("force", "force"));
            parameters.Add(new SPParam("ignorenonactive", "ignore"));
            parameters.Add(new SPParam("scope", "s", false, "Feature", scopeValidator));


            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nDeactivates a feature at a given scope.\r\n\r\nParameters:");
            sb.Append("\r\n\t{-filename <relative path to Feature.xml> |");
            sb.Append("\r\n\t -name <feature folder> |");
            sb.Append("\r\n\t -id <feature Id>}");
            sb.AppendFormat("\r\n\t[-scope <{0}> (defaults to Feature)]", scopeValidator.DisplayValue);
            sb.Append("\r\n\t[-url <url>]");
            sb.Append("\r\n\t[-force]");
            sb.Append("\r\n\t[-ignorenonactive]");

            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BackupSites"/> class.
        /// </summary>
        public BackupSites()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", false, null, new SPUrlValidator()));
            parameters.Add(new SPParam("scope", "s", false, "site", new SPRegexValidator("(?i:^Farm$|^WebApplication$|^Site$)")));
            parameters.Add(new SPParam("path", "p", true, null, new SPDirectoryExistsValidator()));
            parameters.Add(new SPParam("overwrite", "overwrite"));
            parameters.Add(new SPParam("includeiis", "iis"));
            parameters.Add(new SPParam("nositelock", "nositelock"));
            parameters.Add(new SPParam("usesnapshot", "usesnapshot"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nBackup all sites within the specified scope.  If the scope is farm or webapplication then IIS will also be backed up.\r\n\r\nParameters:");
            sb.Append("\r\n\t-path <path to backup directory (all backups will be placed in a folder beneath this directory)>");
            sb.Append("\r\n\t[-scope <Farm | WebApplication | Site>]");
            sb.Append("\r\n\t[-url <url of web application or site to backup (not required if the scope if farm)>]");
            sb.Append("\r\n\t[-includeiis]");
            sb.Append("\r\n\t[-overwrite]");
            sb.Append("\r\n\t[-nositelock]");
            sb.Append("\r\n\t[-usesnapshot]");

            Init(parameters, sb.ToString());
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportNavigation"/> class.
        /// </summary>
        public ImportNavigation()
        {
            SPParamCollection parameters = new SPParamCollection();
            StringBuilder     sb         = new StringBuilder();

#if MOSS
            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the site collection."));
            parameters.Add(new SPParam("inputfile", "input", true, null, new SPFileExistsValidator(), "Please specify the input file name."));
            parameters.Add(new SPParam("deleteexistingglobal", "deleteglobal", false, "true", new SPTrueFalseValidator(), "Please specify either \"true\" or \"false\"."));
            parameters.Add(new SPParam("deleteexistingcurrent", "deletecurrent", false, "true", new SPTrueFalseValidator(), "Please specify either \"true\" or \"false\"."));
            parameters.Add(new SPParam("backuptarget", "backup", false, null, new SPDirectoryExistsAndValidFileNameValidator(), "Make sure the backup file directory exists and a valid filename is provided."));
            parameters.Add(new SPParam("scope", "s", false, "site", new SPRegexValidator("(?i:^Site$|^Web$)")));
            parameters.Add(new SPParam("includechildren", "ic"));

            sb.Append("\r\n\r\nRebuilds the Global and/or Current navigation based on a passed in XML file which can be generated by the gl-enumnavigation command and then modified (note that the Id attribute is ignored).\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <site collection url>");
            sb.Append("\r\n\t-inputfile <xml file to use as input>");
            sb.Append("\r\n\t[-scope <Site | Web> (defaults to Site)]");
            sb.Append("\r\n\t[-deleteexistingglobal <true (default) | false>]");
            sb.Append("\r\n\t[-deleteexistingcurrent <true (default) | false>]");
            sb.Append("\r\n\t[-includechildren (applicable when the scope is Web only)]");
            sb.Append("\r\n\t[-backuptarget <filename>]");
#else
            sb.Append(NOT_VALID_FOR_FOUNDATION);
#endif

            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportListSecurity"/> class.
        /// </summary>
        public ImportListSecurity()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the web url import security to."));
            parameters.Add(new SPParam("inputfile", "file", true, null, new SPDirectoryExistsAndValidFileNameValidator()));
            parameters.Add(new SPParam("quiet", "quiet", false, null, null));
            parameters.Add(new SPParam("includeitemsecurity", "items"));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nImports security settings using data output from gl-exportlistsecurity.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <url to import security to>");
            sb.Append("\r\n\t-inputfile <file to import settings from>");
            sb.Append("\r\n\t[-quiet]");
            sb.Append("\r\n\t[-includeitemsecurity]");
            Init(parameters, sb.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteList"/> class.
        /// </summary>
        public DeleteList()
        {
            SPParamCollection parameters = new SPParamCollection();

            parameters.Add(new SPParam("url", "url", true, null, new SPUrlValidator(), "Please specify the list view URL."));
            parameters.Add(new SPParam("listname", "list", false, null, new SPNonEmptyValidator()));
            parameters.Add(new SPParam("force", "f"));
            parameters.Add(new SPParam("backupdir", "backup", false, null, new SPDirectoryExistsValidator()));

            StringBuilder sb = new StringBuilder();

            sb.Append("\r\n\r\nDeletes a list.\r\n\r\nParameters:");
            sb.Append("\r\n\t-url <list view URL or web url>");
            sb.Append("\r\n\t[-listname <list name if url is a web url and not a list view url>]");
            sb.Append("\r\n\t[-force]");
            sb.Append("\r\n\t[-backupdir <directory to backup the list to>]");
            Init(parameters, sb.ToString());
        }