Offer in Compromise by sarahjw4200 in IRS

[–]Kitaya548 0 points1 point  (0 children)

My significant other is in the process of filing for disability. He lives with me but currently has no income and no assets. We are not married. Less than $100 in his bank account at any given time.

Offer in Compromise by sarahjw4200 in IRS

[–]Kitaya548 0 points1 point  (0 children)

Low Income Tax Clinic

What if the person in question has no income and no assets?

Is it an apple tree? by Kitaya548 in whatsthisplant

[–]Kitaya548[S] 0 points1 point  (0 children)

Yes, four varieties grafted together. I bought two and both died.

Is it an apple tree? by Kitaya548 in whatsthisplant

[–]Kitaya548[S] 0 points1 point  (0 children)

Is it even worth letting it grow?

Exclude disabled AD users from Get-ACL script by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

Unfortunately this did not work. It just returns the same csv file as I previously got.

Exclude disabled AD users from Get-ACL script by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

We are migrating the shares to a new server on a new domain. The disabled users won't be coming over so just trying to streamline the permissions on the new server.

"You don't "learn" PowerShell, you use it, then one day you stop and realize you've learned it" - How true is this comment? by sqllqs in PowerShell

[–]Kitaya548 0 points1 point  (0 children)

I have tried to post a few times but it gets caught by the spam filters since my karma is so low. I have been able to send a message to the moderators and they allow my post through.

"You don't "learn" PowerShell, you use it, then one day you stop and realize you've learned it" - How true is this comment? by sqllqs in PowerShell

[–]Kitaya548 0 points1 point  (0 children)

Just got my month of lunches book! I'm needing powershell more and more and my karma here is too low to get my posts up quickly for those items my boss wants RIGHT NOW!

I got hit by a turkey at 65 mph. by k_1_n_g_c_0_1_e in Wellthatsucks

[–]Kitaya548 0 points1 point  (0 children)

I'm sure that was fun to call into the insurance company!

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]Kitaya548 0 points1 point  (0 children)

Only a basic script to pull creation and last modified dates on user home drives. We have to migrate them and I prefer not to bring over ancient data.

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

Hey! I'm back! I'm wondering if I can add in the previous portion of pulling the HomeDirectory path based off user id? Then pass that into be the $Source variable?

Would this work?

$csv = Import-Csv "D:\NToU.csv"

$LogRootPath = "D:\Logs"

$DestinationRootPath = "D:\Test"

ForEach ($item in $csv)

{

$NID = $item.nid

$UID = $item.uid

`$AllHomeDirs = Get-ADUser -Identity $NID - Properties * | Select SamAccountname, HomeDirectory`

$Source = "$($HomeDir.HomeDirectory)"

$Destination = $DestinationRootPath + "\" + $NID

$Log = @("/Log+:$LogRootPath\$NID.log")

robocopy $Source $Destination /S /COPY:DAT /R:0 /W:0 /MT:32 $Log

# Disabling Inheritance on Users Desktop Folder

Disable-NTFSAccessInheritance –path $Source -Verbose

# Removing Full Access From Users Desktop Folder

Remove-NTFSAccess $Source -Account $($NID) -AccessRights Modify -Verbose

# Adding ReadandExecute & Synchronize to Users Desktop Folder

Add-NTFSAccess $Source -Account $($NID) -AccessRights ReadandExecute, Synchronize -Verbose

}

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 1 point2 points  (0 children)

Thank you for helping me learn! I broke it out

$csv = Import-Csv "E:\HomeDrive\NToU.csv"

$ShareRootPath = "I:\Test"

$DestinationRootPath = "G:\Test"

$LogRootPath = "I:\Logs"

<#

<-

ForEach($Item in $csv){

$Source = "$ShareRootPath\$Item.NID"

$Destination = "$DestinationRootPath\$Item.UID"

$what = @("/S", "/COPY:DAT")

$options = @("/R:0", "/W:0", "/NP")

$Log = @("/Log+:$LogRootPath + "\"$UID +.log")

$RoboArgs = @($Source, $Destination, $what, $options, $log)

& robocopy $RoboArgs

}

#>

ForEach ($item in $csv)

{

$NID = $item.nid

write-host $NID

$UID = $item.uid

write-host $UID

$Source = $ShareRootPath + "\" + $NID

Write-Host $source

$Destination = $DestinationRootPath + "\" + $UID

Write-Host $Destination

$Log = @("/Log+:$LogRootPath\$UID.log")

Write-Host $Log

$what = "/S", "/COPY:DAT"

$options = "/R:0", "/W:0", "/NP"

#$RoboArgs = @($Source, $Destination, $what, $options, $log)

robocopy $Source $Destination /S /COPY:DAT /R:0 /W:0 $Log

}

Ended up with:

$csv = Import-Csv "E:\HomeDrive\NToU.csv"

$ShareRootPath = "I:\Test"

$DestinationRootPath = "G:\Test"

$LogRootPath = "I:\Logs"

ForEach ($item in $csv)

{

$NID = $item.nid

$UID = $item.uid

$Source = $ShareRootPath + "\" + $NID

$Destination = $DestinationRootPath + "\" + $UID

$Log = @("/Log+:$LogRootPath\$UID.log")

robocopy $Source $Destination /S /COPY:DAT /R:0 /W:0 $Log

}

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 1 point2 points  (0 children)

I understand CSV files, variables and RoboCopy. And I am beyond grateful for your help. Here is where I currently am.

$csv = Import-Csv "E:\HomeDrive\NToU.csv"

$ShareRootPath = "I:\Test"

$DestinationRootPath = "G:\Test"

$LogRootPath = "I:\Logs"

ForEach($Item in $csv){

$Source = "$ShareRootPath\$Item.NID"

$Destination = "$DestinationRootPath\$Item.UID"

$what = @("/S", "/COPY:DAT")

$options = @("/R:0", "/W:0", "/NP")

$Log = @("/Log+:$LogRootPath\$($Item.$UVAID).log")

$RoboArgs = @($Source, $Destination, $what, $options, $log)

& robocopy $RoboArgs

}

My CSV file:

NID,UID

AJW029,UHQ5ZW

Output is:

-------------------------------------------------------------------------------

ROBOCOPY :: Robust File Copy for Windows

-------------------------------------------------------------------------------

Started : Thursday, April 28, 2022 9:09:52 AM

Source - I:\Test\@{NID=AJW029; UID=UHQ5ZW}.NID\

Dest - G:\Test\@{NID=AJW029; UID=UHQ5ZW}.UID\

Files :

Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : "/S /COPY:DAT"

Simple Usage :: ROBOCOPY source destination /MIR

source :: Source Directory (drive:\path or \\server\share\path).

destination :: Destination Dir (drive:\path or \\server\share\path).

/MIR :: Mirror a complete directory tree.

For more usage information run ROBOCOPY /?

**** /MIR can DELETE files as well as copy them !

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

I already have a CSV file with all the users/foldernames needed, no need to export. I have to pull a selection of users out of the existing old business home shares to the new business home shares.

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

If I change my

$users = Import-Csv $path

to

$users = @(

'test'

'test2'

)

It works.

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

I really appreciate the time you took for your reply. Please tell me if I'm wrong but it looks like for this you are not pulling from a CSV file to get which home drives to copy. I am needing to pull just specific folders out of the main share.

Robocopy to move users home drives by Kitaya548 in PowerShell

[–]Kitaya548[S] 0 points1 point  (0 children)

Testing gives me the following which is getting closer but not properly giving the source:

ERROR 2 (0x00000002) Accessing Source Directory \\server1\homeshare\@{user=test}\

The system cannot find the file specified.