Date in filename in a export
I want to have in csv file the date and time from today , how can help me ?Get-Childitem -path D:\acr-share\AOP\EPL\*\operation -filter *.epl -recurse | Select Directory,Name,CreationTime,Lastwritetime...
View ArticleInvoke-Command HRESULT 0x80072020
Hi All, I am trying the run an invoke command using domain credentials to query a list of GPOs. The error is An operations error occurred. (Exception from HRESULT: 0x80072020)+ CategoryInfo :...
View ArticlePowerShell code to delete all the unique permission associated to a sub-site.
PowerShell code to delete all the unique permissions associated to a sub-site. asnp *sh* $webUrl="https://XXXXX/sites/opstest/Aditest/" $web = Get-SPweb $webUrl if($Web.HasUniqueRoleAssignments -ne...
View Articletry remote from linux powershell wot einods server
I have done the following steps on Windows serverwinrmsetwinrm/config/Service/Auth@{Basic="true"}winrmsetwinrm/config/Service@{AllowUnencrypted="true"}on linux centos 7in powershell I tryed$creds =...
View ArticleHow to refresh a PowerBI Report using Invoke-RestMethod?
we are using the following command to try refreshing a report: before refreshing, we test to see if the report API works goodInvoke-RestMethod -UseDefaultCredentials -uri...
View ArticleHow do I parse through multiple inputs?
Morning! So I have a PowerShell server build script that does the following as part of it: Asks if you want to add an AD group to Administrators on the server you're building, or if you want to search...
View ArticleIm trying to send to files with winscp
Hi All,Im trying to send two files with winscp to an sftp server. I tried so many things. Im lost.It need to find the files created in the last 8 hours and then send them to the sftp. I only can do one...
View Articlepowershell command to remove permission for a group
Hi,Group scope is GLOBAL and Group type is SECURITY. Permission "Write-ms-Mcs-AdmPwd" needs to be removed for many groups. Is there a way to remove it using powershell command. please helpRegards,...
View ArticleMerge two arrays
I have the following code, which creates two arrays with different headers. I want to merge those two arrays into a single array called $array, with the data from all four headers and their data:...
View ArticleExport to csv not working in foreach loop
Need your support with the script below.What I try to do:- Connect to Power BI Service to gather some data via Rest Api...
View ArticleExport powershell changes to csv format
I am running this script to add all employee IDs into my active directory >> Import-Module ActiveDirectory>> $Users = Import-Csv -Path C:\excelfiles\importtest.csv>> Get-Content -Path...
View ArticleConnect/Dissconect ISCSI connections
I'm working on a powershell script that exports specific VMs from a given text file. What I would like to do now when I run this script from a scheduled task is to have the script connect to a ISCSI...
View Articlescreen remote does not work
If i use the invoke-command with pathfile etc to start a client wich pupose is to make a instrument screen of a flightsimulator visible the screen does not respond. In listing get-help is visible...
View ArticleCreate query from list
Hello, I am trying to create a sccm collection query from simple text list. This is powershell command i have created: $computerlist= Get-Content C:\Install\collection_from_list\list.txt $Qeury=...
View ArticleRunning Script on Remote Machine
Trying to run this to do an installer on a remote machine. The script Im targeting works when I run it locally on the target machine, but not when I run the script to do it remotely. $s = New-PSSession...
View ArticleImport PFX Certificate on remote computers with script
Hello,I am struggleing to get this working.I have tried variations of Enter-PSSession and Invoke-Command. My current iteration is this:Invoke-Command -ComputerName $RDSH -ScriptBlock {...
View Articlepowershell find specific word document in sharepoint libary
Hi all I am trying to find a word document which has some keywords in it.But I can't get it right.can someone please tell me what I am doing wrong? I am a novice at this.Thanks#Client modules laden...
View ArticleReplacing containing folder with contents
How would I replace a containing folder with its contents, such that its contents are moved into the directory of the containing folder and the containing folder is deleted automatically after they are...
View ArticleUnmount all iso file disks
Hi,I have the snippet of code below which unmounts all disks, the reason for doing this is that before i mount an iso file, since I have no way of telling the path of the iso file on an existing drive,...
View ArticleHow to run power shell script in HTML
Hi Team Need Expert guidance here.I am developing a self service portal in html where i have to call several power shell scripts ,so i am looking for someone who will support me to run or host the...
View Article