sharepoint online – error :: exception when calling "ExecuteQuery" with "0" arguments: "The process has expired"

I'm trying to copy the metadata files and folders from one library to another library. This error appears in SharePoint Online with Powershell CSOM

"Exception when calling" ExecuteQuery "with" 0 "arguments:" The operation has expired. "
It works more than half the time, but often gives me this error when I call the ExecuteQuery () command:

This is my code

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.dll"
Add-Type -Path "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Runtime.dll"

Function Copy-AllFilesWithMetadata
{
  param
    (
        (Parameter(Mandatory=$true)) (Microsoft.SharePoint.Client.Folder) $SourceFolder,
        (Parameter(Mandatory=$true)) (Microsoft.SharePoint.Client.Folder) $TargetFolder
    )
    Try {
        #Get all Files from the source folder
        $SourceFilesColl = $SourceFolder.Files
        $SourceFolder.Context.Load($SourceFilesColl)
        $SourceFolder.Context.ExecuteQuery()

        #Iterate through each file and copy
        Foreach($SourceFile in $SourceFilesColl)
        {
            #Get the source file
            $FileInfo = (Microsoft.SharePoint.Client.File)::OpenBinaryDirect($SourceFolder.Context, $SourceFile.ServerRelativeUrl)

            #Copy File to the Target location
            $TargetFileURL = $TargetFolder.ServerRelativeUrl+"/"+$SourceFile.Name
            (Microsoft.SharePoint.Client.File)::SaveBinaryDirect($TargetFolder.Context, $TargetFileURL, $FileInfo.Stream,$True)

            #Copy Metadata field values
            $SourceListItem = $SourceFile.ListItemAllFields
            $SourceFolder.Context.Load($SourceListItem)
            $SourceFolder.Context.ExecuteQuery()

            #Get the new file created
            $TargetFile = $TargetFolder.Context.Web.GetFileByServerRelativeUrl($TargetFileURL)
            $TargetListItem = $TargetFile.ListItemAllFields

            #Set Metadata values from the source
            $Author =$TargetFolder.Context.web.EnsureUser($SourceListItem("Author").Email)
            $TargetListItem("Author") = $Author
            $Editor =$TargetFolder.Context.web.EnsureUser($SourceListItem("Editor").Email)
            $TargetListItem("Editor") = $Editor
            $TargetListItem("Created") = $SourceListItem("Created")
            $TargetListItem("Modified") = $SourceListItem("Modified")
            $TargetListItem.Update()
            $TargetFolder.Context.ExecuteQuery()

            Write-host -f Green "Copied File '$($SourceFile.ServerRelativeUrl)' to '$TargetFileURL'"
        }

        #Process Sub Folders
        $SubFolders = $SourceFolder.Folders
        $SourceFolder.Context.Load($SubFolders)
        $SourceFolder.Context.ExecuteQuery()
        Foreach($SubFolder in $SubFolders)
        {
            If($SubFolder.Name -ne "Forms")
            {
                #Prepare Target Folder
                $TargetFolderURL = $SubFolder.ServerRelativeUrl -replace $SourceLibrary.RootFolder.ServerRelativeUrl, $TargetLibrary.RootFolder.ServerRelativeUrl
                Try {
                        $Folder=$TargetFolder.Context.web.GetFolderByServerRelativeUrl($TargetFolderURL)
                        $TargetFolder.Context.load($Folder)
                        $TargetFolder.Context.ExecuteQuery()
                    }
                catch {
                        #Create Folder
                        if(!$Folder.Exists)
                        {
                            $TargetFolderURL
                            $Folder=$TargetFolder.Context.web.Folders.Add($TargetFolderURL)
                            $TargetFolder.Context.Load($Folder)
                            $TargetFolder.Context.ExecuteQuery()
                            Write-host "Folder Added:"$SubFolder.Name -f Yellow
                        }
                    }
                #Call the function recursively
                Copy-AllFilesWithMetadata -SourceFolder $SubFolder -TargetFolder $Folder
            }
        }
    }
    Catch {
        write-host -f Red "Error Copying File!" $_.Exception.Message
    }
}

#Set Parameter values
$SourceSiteURL= Read-Host -Prompt 'Enter Source Site URL'
$TargetSiteURL= Read-Host -Prompt 'Enter Target Site URL'

$SourceLibraryName= Read-Host -Prompt 'Enter Source Library Name'
$TargetLibraryName= Read-Host -Prompt 'Enter Target Library Name'

#Setup Credentials to connect
$Cred= Get-Credential
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)

#Setup the contexts
$SourceCtx = New-Object Microsoft.SharePoint.Client.ClientContext($SourceSiteURL)
$SourceCtx.Credentials = $Credentials
$TargetCtx = New-Object Microsoft.SharePoint.Client.ClientContext($TargetSiteURL)
$TargetCtx.Credentials = $Credentials

#Get the source library and Target Libraries
$SourceLibrary = $SourceCtx.Web.Lists.GetByTitle($SourceLibraryName)
$SourceCtx.Load($SourceLibrary)
$SourceCtx.Load($SourceLibrary.RootFolder)

$TargetLibrary = $TargetCtx.Web.Lists.GetByTitle($TargetLibraryName)
$TargetCtx.Load($TargetLibrary)
$TargetCtx.Load($TargetLibrary.RootFolder)
$TargetCtx.ExecuteQuery()

#Call the function
Copy-AllFilesWithMetadata -SourceFolder $SourceLibrary.RootFolder -TargetFolder $TargetLibrary.RootFolder


Could someone please help me?

Validation – Is it possible to check the parameter data type in the function without an error in the compilation time when calling this function in C #?

Is it possible to check the parameter data type in the function without an error in the compilation time when calling this function in C #?
I don't want to get a compile-time error while passing the wrong value to the function in C # like Javascript.

The following is my sample code:

class Program
{
    static int containsThatItem(char() arr1, char() arr2)
    {
        Dictionary map = new Dictionary();

        foreach (var e in arr1)
        {
            map.Add(e, true);
        }

        foreach (var e in arr2)
        {
            if (!map.ContainsKey(e))
            {
                continue;
            }

            if (map(e))
            {
                Console.WriteLine("Item Found!");
            }
        }

        return 0;
    }

    static void Main(string() args)
    {
        int() arr1 = { 0, 1, 2, 3 };
        char() arr2 = { 'a', 'b', 'c', 'd'};

        //Here I'm getting compile time error
        containsThatItem(arr1, arr2);   //All I want is to overcome this compile time error by adding validation of datatype inside the containsThatItem method.

        Console.ReadKey();
    }
}

windows – Why calling HEAD at this URL prevents the following error: ERROR: Message: SSL peer certificate or SSH remote key was not OK

This is a problem I have with a particular package, but it looks like the software is using a version of CURL for Windows or something else. I want to understand this specific behavior because it doesn't make sense to me.

I use this software, which is a custom distribution of Clamav for Windows: https://oss.netfarm.it/clamav/

Specifically this version: https://oss.netfarm.it/clamav/files/clamav-x64-0.102.1.7z

I call an exe in this package: & 'c:clamavfreshclam.exe'
And I get the following error:

Trying again in 5 secs...
daily database available for download (remote version: 25759)
ERROR: Download failed (60) ERROR:  Message: SSL peer certificate or SSH remote key was not OK
ERROR: getcvd: Can't download daily.cvd from https://database.clamav.net/daily.cvd
Giving up on https://database.clamav.net...
ERROR: Update failed for database: daily
WARNING: fc_update_databases: fc_update_database failed: Connection failed (5)
ERROR: Database update process failed: Connection failed (5)
ERROR: Update failed.

Don't get it because I can access this URL without any problems. I then determined if HEAD is running on that URL before running the exe. It works:

Invoke-WebRequest -Uri 'https://database.clamav.net/daily.cvd' -Method HEAD
# Now this will work
& 'c:clamavfreshclam.exe'

I think they may have implemented wrong curl libraries or something? I don't understand what it could cause. Does Invoke-Webquest retrieve and cache certificates, but Curl (or the apps that use it) don't?

c ++ – A runtime memory error is displayed when calling strcmp

With the next function I get a memory in the strcmp line when I call this function.

void printMedicationsWithAGivenName(UI* ui, char* name)
{
    name(strlen(name) - 1) = 0;
    DynamicArray* listToPrint = getMedicationsList(ui->controller);
    for (int i = 0; i < getLength(listToPrint); i++)
    {
        if(strcmp(name,get_name(getElementByIndex(listToPrint,i)) == 0)){
            printf("%d ", get_id(getElementByIndex(listToPrint, i)));
            printf("%s ", get_manufacturer(getElementByIndex(listToPrint, i)));
            printf("%s ", get_name(getElementByIndex(listToPrint, i)));
            printf("%d n", get_quantity(getElementByIndex(listToPrint, i)));
        }
    }

When I print name and get_name(getElementByIndex(listToPrint,i)) You print the same string. Even more when I print that strcmp 0 is displayed, which is OK. And it's pretty strange why it throws a memory access error in the for loop, even when there is an element.

This function is called from the user interface in the following way:

if (strcmp(commands(0), "list") == 0)
        printMedicationsWithAGivenName(ui, commands(1));

In the beginning I have

char commands(15)(15);

I have a function that prints all elements without restrictions, without that it looks the same when using strcmp and it works well.

Do you think Trump will regret calling the corona virus a joke if he loses to Joe Biden on November 3?

No, the arrogant Trump has already said that "it was not his responsibility". We have a record of his own words with the timestamp. Every word he said and always corrupt what he did is documented.

For example on January 20th: "I know more about viruses than anyone else.

22nd of January; "We have it completely under control. It's just one person from China. It'll be fine."

February 2: "We pretty much switched it off from China".

February 24 "The corona virus is very well under control in the United States. The stock market looks good to me."

February 25: My administration does a good job dealing with the corona virus. "

February 25: I think it's a problem that is disappearing. You studied it. You know a lot. In fact, we are very close to a vaccine. Very close".

February 26: "The 15 will fall to zero within a few days". (There were 53 cases on February 26th) "We do a lot down, not up".

February 27: "It is a miracle, it will disappear".

February 28: "We order a lot of accessories. We order items that we honestly wouldn't need, but we order many different medical items."

March 2: You are taking a solid flu vaccine that you do not think may or may have a major impact. Many things happen and they happen very quickly ".

March 4th If we have thousands or hundreds of people who only get better from you, sit around and even go to work. Some of them have to go to work, but they are better off. "

March 5: "I never said that".

March 5 "The United States has only 129 cases and 11 deaths. My government is working very hard to keep these numbers down."

March 6: "I think I'm doing a really good job in this country to keep it low – a great job to keep it low. Anyone who needs a test can get a test."

The truth – Dr. Fauci testified before Congress: "The United States does not offer adequate tests for the corona virus – we admit it fails. The idea that someone is easily tested, like people in other countries, we are not prepared for." .

* "We also know that the World Health Organization had job tests that the Republican government rejected, and researchers on a Seattle project were trying to do early tests for the coronavirus, but were prevented by federal officials. The doctors of the research project eventually decided to one Coronavirus test done without federal approval. It gets worse. Trump ignored early warnings and became angry with the CDC official, who warned in February that an outbreak was inevitable. Trump dismantled the National Security Council's global health bureau, the purpose of which it was to warn the American people of a pandemic ".

Swell): *The Atlantic. Peter Wehner: The Trump presidency is over.

reactjs – Clear field before calling the function in React Js

I made a list of tasks and there was a question. First I hand over a function from my father to my son so that he can give me the new tasks.

When my child submits the new task, I have to clean up the input, but I feel that it is not as correct as I am.

I don't know if someone with a similar case could lead me.

Good day

The next component is my subordinate component, in which I create the tasks.

 handleSubmit(e) {
            //debugger; 
            e.preventDefault();

            if (!this.state.nameTaskText.length) {
                    return;
            }

            const newItem = {
                    nameTaskText: this.state.nameTaskText,
                    id: Date.now()
            };

            this.setState({ nameTaskText : "" })
            this.props.onHandleTakeText(newItem); 
        }

        render() {
            return (

                
{' '}
); } }

That would be the part I'm referring to. I update the input to clean it up, and then I send a new task to my father, on the job. It works for me, but I'm not happy.

  this.setState({ nameTaskText : "" })
  this.props.onHandleTakeText(newItem); 

How can I request a refund from Condor Airlines without calling them?

A friend of mine had a ticket with Condor Airlines from Seattle to Prague that was due to depart via Frankfurt on March 16. The flight Frankfurt-Prague (LH1400) has been canceled, so my friend wants a refund for the return flight.

However, Condor's telephone agents are currently unavailable. Can I somehow request a refund via email? Your website doesn't seem to offer such an option.

magento2 – How to retrieve data from a model without calling objectManager in the template

I have a custom Order Model, it has a method in it @method int getEntityId()

I have a template to transfer the ID of the current order/app/code/Qq/Www/view/frontend/templates/success/index/success_page.phtml

How do I get the ID after the form has been submitted by this controller?

        if ($data) {
            /** @var QqWwwModelOrder $model */
            $model = $this->_objectManager->create('QqWwwModelOrder');
            $model->setData($data);
            $model->setStoreId($this->_storeManager->getStore()->getId());

            try {


                $this->objectRepository->save($model);
                $this->messageManager->addSuccess(__('Request was added to processing.'));
                $this->dataPersistor->clear('dv_sample_order');

                // Send email
                $this->helper->sendEmail($model);

            } catch (MagentoFrameworkExceptionLocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the data.'));
            }
        }
        return $resultRedirect->setPath('qq_success_page/success/index');

C # – Why does JavaScript work when calling Ajax when the Asp.Net WebForms page is reloaded?

The problem I have is that when I register an administrator, I perform a JS function with Ajax and it works perfectly on the server side. The problem is that the page is reloaded on return and that is exactly what I hope will not happen, even if the entered data (password) does not meet the specified conditions, the page is also reloaded. I tried to do this with POST and GET without getting satisfactory results.

What can i do wrong

JS code:

function CreateAdministrator() {

    var name = $('#name').val();
    var lastName = $('#lastName').val();
    var user = $('#user').val();
    var a = $('#password').val();
    var b = $('#password2').val();

    if (a !== b) {
        alert('Los passwords deben ser identicos');
        return false;
    } else if (password.length < 10) {
        alert('El password debe contener minimo 10 caracteres');
        return false;
    }

    var may = false;
    var min = false;
    var num = false;
    for (var i = 0; i < a.length; i++) {
        if (a.charCodeAt(i) >= 65 && a.charCodeAt(i) <= 90)
            may = true;
        else if (a.charCodeAt(i) >= 97 && a.charCodeAt(i) <= 122)
            min = true;
        else if (a.charCodeAt(i) >= 48 && a.charCodeAt(i) <= 57)
            num= true;
    }

    if (min === false && may === false) {
        CancelSubmit( 'El password debe contener letras');
        return false;
    }
    if (num === false) {
        CancelSubmit( 'El Password debe contener numeros');
        return false;
    }

    $.ajax({
        type: "GET",
        url: "About.aspx/CreateAdministrator",
        data: JSON.stringify({ name: name , lastName: lastName, user: user, password: a }),
        contentType: "application/json; chartset=utf-8",
        datatype: "json",
        success: function (data) {
            var respuesta = JSON.parse(data.d);
            if (respuesta.Description === 'Administrador creado satisfactoriamente') {
                console.log(respuesta);
                alert(respuesta.Description);
                NavePage('Default.aspx');
            }
            else {
                alert(respuesta.Description);
            }
        },
        complete: function () {
            console.log('CREATEADMINISTRATOR');
        }
    }); 

}

function CancelSubmit(msj) {
    document.getElementById('validacion').innerHTML = msj;
    document.getElementById('validacion').style.display = 'block';
    setTimeout(HideValidation, 10000);
}

function HideValidation() {
    document.getElementById('validacion').style.display = 'none';
    $('#password').val('');
    $('#password2').val('');
}

function NavePage(page) {
    window.location.href = page;
}

HTML code:



     
     
     
     
     
     
     


 

New administrator











C # code:

 (WebMethod)
        public static string CreateAdministrator (string name , string lastName , string user, string password)
        {
            ResponseWM response = new ResponseWM();
            response.Description = "Fallo crear administrador";
            response.Result = false;
            try
            {
                password = EngineTool.ConvertirBase64(user + password);
                EngineProject Funcion = new EngineProject();
                Administrator adm = Funcion.SetAdministrator(name, lastName, user, password);
                EngineDb Metodo = new EngineDb();
                bool result = Metodo.CreateAdministrator(adm);
                if (result)
                {
                    response.Description = "Administrador creado satisfactoriamente";
                    response.Result = true;
                }
            }
            catch { }

            return JsonConvert.SerializeObject(response);
        }

get_post_meta returns a bool (false) calling post from Ajax

There is a function that fixes the problem of displaying bool (false) when I call get_post_meta with Ajax. Bool (false) display with a var_dump Otherwise I have nothing.

I only get this problem with Ajax. With my single.php the get_post_meta is displayed.

I have no error, just "bool (false)".
Do you know where the problem comes from?