ECMA script for checking active workflows for an list item

Hi i am having more than 1 workflow associated with the list if there is any workflow that is active for an item then i need to prevent starting another workflow for the same item. I am using the following code to achieve the same. Can anyone please provide me the ECMA client script object model equivalent for achieving the same.

//Check for any active workflows for the document     private void CheckForActiveWorkflows()     {         // Parameters 'List' and 'ID' will be null for site workflows.         if (!String.IsNullOrEmpty(Request.Params["List"]) && !String.IsNullOrEmpty(Request.Params["ID"]))         {             this.workflowList = this.Web.Lists[new Guid(Request.Params["List"])];             this.workflowListItem = this.workflowList.GetItemById(Convert.ToInt32(Request.Params["ID"]));          }         SPWorkflowManager manager = this.Site.WorkflowManager;         SPWorkflowCollection workflowCollection = manager.GetItemActiveWorkflows(this.workflowListItem);         if (workflowCollection.Count > 0)             SPUtility.TransferToErrorPage("An workflow is already running for the document. Kindly complete it before starting a new workflow");     } 

Como puedo pasar los datos de mi Formulario html a traves de un script Perl?

estoy comenzando a hacer scripts en perl pero no porque me sale este error: Este es mi formulario en html ya vi los name de cada input, tambien vi la ruta del action que este bien. Y nada sigue apareciendo un error…

<!DOCTYPE HTML> <html> <head> 	<title>Mi FORMULARIO</title> 	<link rel="stylesheet" type="text/css" href="../estilos/estio.css"> </head> <body> 	<form action="../cgi-bin/FORMULARIO.pl" method="post"> 		<label for="nombre">Nombres: </label> 		<input  name="nombre" type="text" id="nombre"   placeholder="Escribe tu nombre"> 		<label for="Email">Email</label> 		<input name="apellido" type="text" id="Email" placeholder="Escribe tus apellidos"> 		<label for="mensaje" >Mensaje:</label> 		<textarea name="texto" type="text" id="mensaje" placeholder="Escribe tu mensaje"></textarea> 		<input type="submit" value="Enviar"> 	</form>  </body> </html>

Ahora voy a mostrar el script en perl, es basico…

introducir el código aquí #!usr/bin/perl -wT   use CGI; use strict;  my $  cgi=new CGI;  my $  nombre    = $  cgi ->param("nombre"); my $  apellido  = $  cgi ->param("apellido"); my $  texto     = $  cgi ->param("texto");  my $  cabecera = $  cgi->header(-type => "text/html");    print $  cabecera;    print "<h1>Mucho gusto" .$  nombre .$  apellido."</h1>"."\n";    print "<h1>Gracias por tu comentario</h1>";    print "<a href='../html/MiFORM.html'>Regresar al formulario</a>"; 

Y mi el error que me sale es: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.29 (Ubuntu) Server at 34.70.178.207 Port 80

Cual es mi error?

Session ID in SQLCMD running multi-batch script

My script contains multiple GO keywords. I know that SQLCMD interprets GO as a batch delimiter, so the code is not run as a single block but instead each part between the delimiters (a batch) is run separately. My question is, are all batches executed in the same session?

I tried testing this using a simple script like this:

SELECT @@SPID GO  SELECT @@SPID GO  SELECT @@SPID GO 

I then ran the script from the command line using this command

SQLCMD -S MyServer\Instance -E -i MyScript.sql 

and got this output:

 ------     62  (1 rows affected)  ------     62  (1 rows affected)  ------     62  (1 rows affected) 

It seemed to answer my question in the affirmative, but then I ran the script again and got exactly the same output, i.e. all values were 62 again. Apparently the two separate executions of SQLCMD could not possibly run in the same session, they just happened to receive the same session ID. But that in turn makes me think that the same @@SPID value return by a single run might not necessarily mean it was the same session either. Each batch could be executed in a different session that just happened to receive the same ID, similar to how different executions of SQLCMD were running in different sessions with the same ID.

Therefore, my question still stands: are multiple batches of the same script executed in SQLCMD in the same session or not? Is there a way to determine this?

Site Script stuck at 0%

My site script get suck at 0% when creating site and i cant figure out why?

Script works fine exept when i add one of theese three verbs it gets stuck at 0%

{         "verb": "joinHubSite",         "hubSiteId": "5d5dc7e2-92fb-45ae-a2af-1569b7f72e32"     },         {         "verb": "setSiteLogo",         "url": "https://chickoman.sharepoint.com/sites/PP/SiteAssets/__sitelogo__sitelogo.jpg"     },     {         "verb": "applyTheme",         "themeName": "Green Custom"     },     $  site_script = '{ "$  schema": "schema.json", "actions": [     {         "verb": "joinHubSite",         "hubSiteId": "5d5dc7e2-92fb-45ae-a2af-1569b7f72e32"     },         {         "verb": "setSiteLogo",         "url": "https://chickoman.sharepoint.com/sites/PP/SiteAssets/__sitelogo__sitelogo.jpg"     },     {         "verb": "applyTheme",         "themeName": "Green Custom"     },        {         "verb": "addPrincipalToSPGroup",         "principal": "TestUser@chickoman.onmicrosoft.com", /* user */         "group": "Owners"     },     {         "verb": "createSPList",         "listName": "Documents",         "templateType": 101,         "subactions":          [             {                 "verb": "setDescription",                 "description": "DokumentBibliotek"             }         ]     },     {         "verb": "createSiteColumn",         "fieldType": "User",         "internalName": "siteColumnInfAnsv",         "displayName": "Informationsansvarig",          "isRequired": true,         "group": "Custom kolumner"     },     {         "verb": "createSiteColumn",         "fieldType": "User",         "internalName": "siteColumnResultAnsv",         "displayName": "Resultatansvarig",           "isRequired": true     },     {         "verb": "createSiteColumn",         "fieldType": "Boolean",         "internalName": "siteColumnSlutGiltig",         "displayName": "Slutgiltig",         "isRequired": true     },             {         "verb": "createSiteColumn",         "fieldType": "DateTime",         "internalName": "siteColumnSlutDat",         "displayName": "Slutdatum",         "isRequired": false     },     {         "verb": "createSiteColumn",         "fieldType": "User",         "internalName": "siteColumnUpgAnsv",         "displayName": "Uppgiftsansvarig",         "isRequired": true     },     {         "verb": "createSiteColumn",         "fieldType": "Text",         "internalName": "siteColumnBeskriv",         "displayName": "Beskrivning",         "isRequired": false     },     {         "verb": "createSiteColumn",         "fieldType": "Text",         "internalName": "siteColumnEnhet",         "displayName": "Enhet",         "isRequired": false     },     {         "verb": "createContentType",         "name": "Projektdokument",         "description": "Eget Dokument innehållstyp",         "parentName": "Document",         "hidden": false,         "subactions":         [             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnInfAnsv"             },             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnSlutGiltig"             },             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnBeskriv"             }         ]     },     {         "verb": "createContentType",         "name": "Projektuppgift",         "description": "Custom ContentType",         "parentName": "Item",         "hidden": false,         "subactions":         [             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnSlutDat"             },             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnUpgAnsv"             },             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnBeskriv"             }         ]     },     {         "verb": "createContentType",         "name": "Projektresultat",         "description": "Projekt Resultat ContentType",         "parentName": "Projektdokument",         "hidden": false,         "subactions":         [             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnResultAnsv"             },             {                 "verb": "addSiteColumn",                 "internalName": "siteColumnEnhet"             }         ]     },      {         "verb": "createSPList",         "listName": "Projektuppgifter",         "templateType": 100,         "subactions":          [             {                 "verb": "setDescription",                 "description": "Arbetsdokumenten med innehållstyp "             },             {                 "verb": "addContentType",                 "name": "Projektuppgift"             },          ]         },      {         "verb": "createSPList",         "listName": "Arbetsdokument",         "templateType": 101,         "subactions":          [             {                 "verb": "setDescription",                 "description": "Arbetsdokument lista "             },             {                 "verb": "addContentType",                 "name": "Projektdokument"             }         ]     },     {         "verb": "createSPList",         "listName": "Resultat",         "templateType": 101,         "subactions":          [             {                 "verb": "setDescription",                 "description": "Resultat Lista "             },             {                 "verb": "addContentType",                 "name": "Projektresultat"             }         ]     },  ], 

}’

Need script to list Groups by Team Site

I am trying to find PowerShell scripts that do the following:

  1. List all TeamSites.

  2. List all TeamSites, Groups that belong to that TeamSite with their permissions.

  3. List all TeamSites, Groups that belong to that TeamSite with their permissions as well as the users that belong to those groups (grouped by group).

This would be for SharePoint online.

Is this possible? Any help would be greatly appreciated.

Error while running shell script inside ubuntu VM: -bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory

I have 3 shell script files placed inside vagrant directory like so: files placement screenshot

This is the install.sh file:

#!/bin/bash  echo "Launching instances with the following parameters:" echo "" echo "Machine Image ID: $  1" echo "Number of Instances: $  2" echo "Instance Type: $  3" echo "Key Pair Name: $  4" echo "Security Group ID: $  5"  aws ec2 run-instances --image-id $  1 --count $  2 --instance-type $  3 --key-name $  4 --user-data file://install-env.sh --security-group-ids $  5 

This is the install-env.sh file:

#!/bin/bash  sudo apt-get -y update sudo apt-get -y install apache2 php php-gd mysql-server  sudo systemctl enable apache2 sudo systemctl start apache2  

I have another destroy.sh file but it’s not related to this error as of now. This is the command I am trying to execute after I ssh into ubuntu VM (I replaced the ami & sg numbers with * for posting it here):

vagrant@ubuntu-bionic:/vagrant$   ./install.sh ami-*************** 1 t2.micro key-name sg-************** 

This is the error that I am getting:

-bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory 

The same command works fine if I have those shell script inside home directory, (which I am not able to see on the UI) and I run the command without navigating to vagrant directory like so:

vagrant@ubuntu-bionic:$   ./install.sh ami-********** 1 t2.micro key-name sg-************** 

Why does it not work if I place the files inside vagrant directory? I want to place it here so that I can make changes in one place and push/pull to/from github, instead of having to copy-paste my changes and then push to github everytime.

Please guide me through the placement of shell script files and the directory navigation on cmd prompt.

Error while running shell script inside ubuntu VM: -bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory

I have 3 shell script files placed inside vagrant directory like so: files placement screenshot

This is the install.sh file:

#!/bin/bash  echo "Launching instances with the following parameters:" echo "" echo "Machine Image ID: $  1" echo "Number of Instances: $  2" echo "Instance Type: $  3" echo "Key Pair Name: $  4" echo "Security Group ID: $  5"  aws ec2 run-instances --image-id $  1 --count $  2 --instance-type $  3 --key-name $  4 --user-data file://install-env.sh --security-group-ids $  5 

This is the install-env.sh file:

#!/bin/bash  sudo apt-get -y update sudo apt-get -y install apache2 php php-gd mysql-server  sudo systemctl enable apache2 sudo systemctl start apache2  

I have another destroy.sh file but it’s not related to this error as of now. This is the command I am trying to execute after I ssh into ubuntu VM (I replaced the ami & sg numbers with * for posting it here):

vagrant@ubuntu-bionic:/vagrant$   ./install.sh ami-*************** 1 t2.micro key-name sg-************** 

This is the error that I am getting:

-bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory 

The same command works fine if I have those shell script inside home directory, (which I am not able to see on the UI) and I run the command without navigating to vagrant directory like so:

vagrant@ubuntu-bionic:$   ./install.sh ami-********** 1 t2.micro key-name sg-************** 

Why does it not work if I place the files inside vagrant directory? I want to place it here so that I can make changes in one place and push/pull to/from github, instead of having to copy-paste my changes and then push to github everytime.

Please guide me through the placement of shell script files and the directory navigation on cmd prompt.

Error while running shell script inside ubuntu VM: -bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory

I have 3 shell script files placed inside vagrant directory like so: files placement screenshot

This is the install.sh file:

#!/bin/bash  echo "Launching instances with the following parameters:" echo "" echo "Machine Image ID: $  1" echo "Number of Instances: $  2" echo "Instance Type: $  3" echo "Key Pair Name: $  4" echo "Security Group ID: $  5"  aws ec2 run-instances --image-id $  1 --count $  2 --instance-type $  3 --key-name $  4 --user-data file://install-env.sh --security-group-ids $  5 

This is the install-env.sh file:

#!/bin/bash  sudo apt-get -y update sudo apt-get -y install apache2 php php-gd mysql-server  sudo systemctl enable apache2 sudo systemctl start apache2  

I have another destroy.sh file but it’s not related to this error as of now. This is the command I am trying to execute after I ssh into ubuntu VM (I replaced the ami & sg numbers with * for posting it here):

vagrant@ubuntu-bionic:/vagrant$   ./install.sh ami-*************** 1 t2.micro key-name sg-************** 

This is the error that I am getting:

-bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory 

The same command works fine if I have those shell script inside home directory, (which I am not able to see on the UI) and I run the command without navigating to vagrant directory like so:

vagrant@ubuntu-bionic:$   ./install.sh ami-********** 1 t2.micro key-name sg-************** 

Why does it not work if I place the files inside vagrant directory? I want to place it here so that I can make changes in one place and push/pull to/from github, instead of having to copy-paste my changes and then push to github everytime.

Please guide me through the placement of shell script files and the directory navigation on cmd prompt.

Error while running shell script inside ubuntu VM: -bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory

I have 3 shell script files placed inside vagrant directory like so: files placement screenshot

This is the install.sh file:

#!/bin/bash  echo "Launching instances with the following parameters:" echo "" echo "Machine Image ID: $  1" echo "Number of Instances: $  2" echo "Instance Type: $  3" echo "Key Pair Name: $  4" echo "Security Group ID: $  5"  aws ec2 run-instances --image-id $  1 --count $  2 --instance-type $  3 --key-name $  4 --user-data file://install-env.sh --security-group-ids $  5 

This is the install-env.sh file:

#!/bin/bash  sudo apt-get -y update sudo apt-get -y install apache2 php php-gd mysql-server  sudo systemctl enable apache2 sudo systemctl start apache2  

I have another destroy.sh file but it’s not related to this error as of now. This is the command I am trying to execute after I ssh into ubuntu VM (I replaced the ami & sg numbers with * for posting it here):

vagrant@ubuntu-bionic:/vagrant$   ./install.sh ami-*************** 1 t2.micro key-name sg-************** 

This is the error that I am getting:

-bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory 

The same command works fine if I have those shell script inside home directory, (which I am not able to see on the UI) and I run the command without navigating to vagrant directory like so:

vagrant@ubuntu-bionic:$   ./install.sh ami-********** 1 t2.micro key-name sg-************** 

Why does it not work if I place the files inside vagrant directory? I want to place it here so that I can make changes in one place and push/pull to/from github, instead of having to copy-paste my changes and then push to github everytime.

Please guide me through the placement of shell script files and the directory navigation on cmd prompt.