So what part of your process isn't working as you want?
Light travels faster than sound. That's why some people appear bright until you hear them speak.
I would use a custom object then export the results. Not knowing how your data is structured, I can only give you an idea of what it would look like.
$backups = @()
#<Get Data somehow>
Foreach ($backup in $backups)
{
$backupnode = GetBackupNode
$backupnode = Get-BackupNode.hostname...
Instead of piping all the process to the stop command, you could put them into a variable and then loop through them to stop. Wait a bit and then check if they are stopped or still running.
$processes = get-process | ? { $_.mainwindowtitle -ne "" -and $_.processname -ne "powershell" }...
I see a typo in the first code block:
#get directories$path = "c:\temp\userdirs\"
Should be:
#get directories
$path = "c:\temp\userdirs\"
Light travels faster than sound. That's why some people appear bright until you hear them speak.
Matt
Are you still in need of assistance? I've been away for a while, but I'd be willing to help out, now, if I can.
If so, what would determine if a file was "old and need to be removed"? They don't show as a user in your AD user export?
Assumptions I'm making until I hear from you:
1...
Are you looking for something like this?
New-Variable -name ("TrafficLight"+$xxvariablexx)
Light travels faster than sound. That's why some people appear bright until you hear them speak.
Your code is a bit confusing. But if that is all that isn't working, try this:
param (
[Parameter(Mandatory)]
[String] $Path,
[decimal] $days
)
$text = get-content $path
(Get-Content $path).Replace("`t", " ") | set-content "C:\anil\input555.txt"
$path = "c:\anil\input555.txt"...
You could do the search and replace in one step. Mine are separate functions, because there are some times when I just want to be notified that there are special characters present and then prompt for what action to take; replace or leave.
Anyway, here is how to do it on one step...
This is what I've done:
1. Create an array of all the special character you would like to identify with the double characters, such as the one you're trying to identify, at the beginning.
2. Search the specified string for any of the special characters
3. Replace the special character(s) with...
I don't know SQL, however, I'm wondering if there needs to be a semi-colon at the end of your SQL select statement.
$SqlQuery = "Select Alpha, siteid from MigrationStaging.Map.CashSiteId__ProteanAlpha where siteid = 'AiB3304';"
Light travels faster than sound. That's why some people...
It's not the most elegant, but this should work
Get-ChildItem "C:\Users\Documents\MicroApps\SCAPH_ACL_Project\1_SCAPH_Main\Final_Output_z.xlsx" | ForEach-Object {$_.LastWriteTime = Get-Date; Rename-Item -Path $_ -NewName "Final_Output_z.xlsx"}
Light travels faster than sound. That's why...
Chris,
Most of us are willing to assist you with fixing logic/syntax, but I don't know if anyone is going to want to write the script for you. We've all been where you are. But you need to give it a shot, so you can learn how to do it. Then come back with something we can work from/with if...
I think it might be a difference between our input files. My file names column has a header of "Name", which I reference in the script.
Name <--- Header
File1.jpg <--- File
File2.gif <--- File
File3.txt <--- File
File4.doc <--- File
Light travels faster than sound...
AndiZu,
I would do something like this. You may have to play with the paths to make it work.
Disclaimer: I know almost nothing about the Mac OS, so I have no idea if these commands will work properly or not.
Good luck!
## These are going to have to be changed to match your environment...
Your code doesn't match your output, with regards to which fields you need, so I went with what you provided as output.
I would do it like this:
## Set export location
$export_location = "C:\Temp\SharePoint_Users.csv"
## Get all users and necessary attributes
$users = Get-ADUser -Filter *...
You could just get the manager information from AD when you're getting the user information.
What is the code you are using to get the user information?
Light travels faster than sound. That's why some people appear bright until you hear them speak.
Dave,
I don't think that would work, because you'd never get AA*. The first TLA would be ABC.
Blue,
It isn't very elegant, but try this:
$List = "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"
$k = $list.count
$res = @()
for ($h=0; $h...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.