We have some Task scheduler jobs configured on Windows server (OS 2016). Few jobs were configured with "XYZ" service account and it's password. This particular user profile was taking a lot of space which is abnormal. The user profile cleanup was performed to free up the space in C drive. Based on our analysis, after the cleanup, the value of the argument "password" is being passed as "null". The jobs which are running using the account is throwing error mentioning "Access is denied". Please provide us any solution.
Error Example from 3 different jobs-
An error has occurred while connecting to the SharePoint Online site. Aborting...
Connect-PnPOnline : Access is denied
At D:****\GetAllUsersProfiles_AllProps.ps1:111 char:5
7:11
An error has occurred while establishing a connection with target site. | Error |
2024-04-08 09:23:02.5082 | New-Object : Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the
value of argument "password" is null. Change the value of argument "password" to a non-null
value."
At D:****\Utils.ps1:41 char:13
| Error |
7:13
2024-04-05 13:51:26.0172|Error: System.Management.Automation.PSInvalidOperationException: Unable to connect using provided arguments
at PnP.PowerShell.Commands.Base.ConnectOnline.Connect(CancellationToken& cancellationToken)
at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
2024-04-05 13:51:26.0640|*******Total Execution Time is @{Days=0; Hours=0; Minutes=6; Seconds=47} ******
2024-04-05 13:51:26.2359|************ Sync process Completed at 04/05/2024 13:51:26 local time ************
2024-04-05 13:51:32.1370|************ Sync process started at 04/05/2024 13:51:32 local time ************
2024-04-08 12:47:34.0074|Error: System.Management.Automation.PSInvalidOperationException: Unable to connect using provided arguments
at PnP.PowerShell.Commands.Base.ConnectOnline.Connect(CancellationToken& cancellationToken)
at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
2024-04-08 12:47:43.3064|************ Sync process started at 04/08/2024 12:47:43 local time ************