I'm a beginner and i tried to make a simple script to save our current scripts on other admin computer.
So:
$SAVE = Get-ADComputer -filter " name -notlike '* *mycomputer*' " -SearchBase 'OU=Supervision,OU=...'
Foreach ($S in $SAVE)
{
Copy-Item 'd:\doc\*' -destination '\\$S\d$\test'
}
I tried selecting the Name (adding a pipe after the get-adcomputer) but it fail and trying the line copy item without the for each work so i don't know where i went wrong. If someone could point me the problem?
I tried Test-Path \\$A\D$
and it returned a true
Thank