Powershell: How to import csv find a value in a row, list of the column data and over-write some coumns? - powershell

I think it's easiest to show what I have and what I'm trying to get as an output instead of me trying to verbalize what I'm doing and what I've tried.
Input is a csv that contains:
Full Name
Color
Access Type
Access ID
John Smith
Blue
Full_Acccess
jsmith
John Smith
Blue
Partial_Access
John Smith
Red
No_Access
Bill Bob
Red
Full_Access
Bill Bob
Pink
Access_1
Lisa Smith
Green
Access_2
I will call this script each time and look for "Full Name". Then if "Access ID" is empty, I want to populate Access ID (from a variable) and write out the "Output" below to a variable and send that as the body of an email.
So run script, look for "Full Name". In this case, it will look for and finds "Bill Bob" and since Access ID is empty, it will write "Rob Bob" (a variable value) to "Access ID" but also send email body of output below
OutPut:
Full Name: Bill Bob
Color: Red, Pink
Date: 03-21-2021
Access_Type: Full_Access, Access_1
Access ID: Rob Bob
So it's showing a unique Full Name (not all three rows), but also all values of Color and Access Type for "Full Name"
I've got this working using:
Import-CSV |Group-Object -Propert 'Full Name' | Select-Object #{Name = "Full Name"; Expression = {(_.Group.'Full Name' | Select-Object -Unique)}},
#{Name = "Access Type"; Expression = {($_.Group.'Access Type' | Select-Object -Unique) -join ","}},
#{Name = "Color"; Expression = {($_.Group.'Color' | Select-Object -Unique)}},
#{Name = "New Name"; Expression = {($_.Group.'New Name' | Select-Object -Unique)}} |
Where-Object {$_.'Full Name' -eq $PersonName}
Where I'm stuck:
Script will be called and imports CSV and searches for "Bill Bob". Then I want to list all the columns for Bill AND write the new Access_ID value back into the CSV.
Then I call the script again and look for John Smith, and then again for Lisa Smith, etc..
Thanks all!

I think I got what you were going for, here's what I would use:
Function Get-UserAccess ([string]$fullname,[string]$csvpath){
# Export your output
$csv = Import-CSV $csvpath
$filtered = $csv | Where-Object {$_.'Full Name' -eq $fullname}
$output = [pscustomobject]#{
'Full Name' = $fullname
'Access Type'=($filtered.'Access Type' | Select -Unique) -join ','
'Color' =($filtered.'Color' | Select -Unique) -join ','
'Access ID' =($filtered.'Access ID' | Select -Unique) -join ','
}
# check if Access ID is empty on Full_Access users
if (-not $output.'Access ID' -and
($output.'Access Type' -split ',') -contains 'Full_Access') {
# Set your AccessID here
$AccessID = Read-Host "Enter a new access ID for $fullname"
# Update the Access ID in the csv:
$entry = ([Collections.Generic.List[Object]]$csv).findIndex({
$args[0].'Full Name' -eq $fullname -and
$args[0].'Access Type'-eq 'Full_Access'})
$csv[$entry].'Access ID' = $AccessID
Write-Host "Updating $csvpath with new access ID for $fullname"
$csv | Export-Csv $csvpath -Force -NoTypeInformation
# Return output with Access ID
$output.'Access ID' = $AccessID
return $output
} Else { Return $output }
}
And some example usage with the data from your question:
PS C:\> Get-UserAccess 'Bill Bob' 'C:\temp\temp.csv' | fl
Enter a new access ID for Bill Bob: Rob Bob
Updating C:\temp\temp.csv with new access ID for Bill Bob
Full Name : Bill Bob
Access Type : Full_Access,Access_1
Color : Red,Pink
Access ID : Rob Bob
PS C:\> Get-UserAccess 'John Smith' 'C:\temp\temp.csv' | fl
Full Name : John Smith
Access Type : Full_Access,Partial_Access,No_Access
Color : Blue,Red
Access ID : jsmith,

Related

PowerShell -- Import csv, reformat date values, export csv

I have a large volume of CSV records that have a date column that needs to be reformatted. The format in the source files is "MM/dd/yyyy hh:mm". The format I need to change to is "yyyy-MM-dd". I've tried a few different things, and I've been able to get the two pieces to work (import and transform, or export), but not both together.
Sample data
Date Created,ID,Email Address,First Name,Last Name
3/15/2019 14:56,some-string,email#address.com,first,last
3/15/2019 13:56,some-string,email#address.com,first,last
Import and transform (w/ Write-Host to confirm reformat)
Import-Csv .\foo.csv |
ForEach-Object {
$_."Date Created" = [datetime]::Parse($_."Date Created").ToString('yyyy-MM-dd')
Write-Host $_."Date Created"
}
Import and Export (w/ no transform)
Import-Csv foo.csv |
Select-Object "Date Created", ID, "Email Address", "First Name", "Last Name" |
Export-Csv -NoTypeInformation foo-new.csv
I've tried this to combine the two pieces, but I end up with an empty CSV file
Import-Csv foo.csv |
ForEach-Object {
$_."Date Created" = [datetime]::Parse($_."Date Created").ToString('yyyy-MM-dd')
} |
Select-Object "Date Created", ID, "Email Address", "First Name", "Last Name" |
Export-Csv -NoTypeInformation foo-new.csv
Any help to smash these together, so I have my reformat and my successful export, would be greatly appreciated.
You need to use a calculated property with Select-Object
Try
Import-Csv foo.csv |
Select-Object #{Name = 'Date Created'; Expression = { '{0:yyyy-MM-dd}' -f [datetime]$_.'Date Created' }},
* -ExcludeProperty 'Date Created' |
Export-Csv -NoTypeInformation foo-new.csv
Easiest way to go about this is using a calculated property:
Import-Csv -Path C:\users\Abraham\Desktop\csvDate.csv |
Select-Object -Property #{
Name = "DateCreated"
Expression = {
([datetime]$_."Date Created").ToString("yyyy-MM-d")
}
}, ID, "Email Address", "First Name", "Last Name" # | Export-Csv ...
As for what you tried. . .you're basically de-selecting all your properties when piped to Foreach-Object then trying to select what's not already there; hence why you get an empty csv.

How do I match a value in multiple rows in CSV

I have a csv file that contains
Full Name
Some Column
Access Required
John Smith
Stuff
System 1
John Smith
something
System 3
Bob Villa
other
Application 4
Bob Villa
more
Application 6
Doug Mack
stuff
System 2
I'd like to import this csv and match based upon one "full name" at a time (that I'm getting from a variable ie:Full Name) so that I get an out which I'll send as the body of an email that is:
Full Name: John Smith
Access Required: System 1
Access Required: System 3
Then I will run script again looking for Bob Villa and get:
Full Name: Bob Villa
Access Required: Application 4
Access Required: Application 6
I think I could do this with a bunch of "if statements" but I'm wondering if there's a way to parse the csv based upon "full name" and then list all the entries found in the "Access Required" column for each row that "full name" is found?
Note: I don't want anything from any other columns (and there could be lots of them), just want the contents of "Access Required"
Thank you!
Import the csv in a variable and select the data for the user by the full name:
$data = Import-Csv -Path 'path\to\input.csv'
# example select John Smith
$user = 'John Smith'
$selection = $data | Where-Object {$_.'Full Name' -eq $user}
if (#($selection).Count) {
# format as you like, for simplicity
$table = $selection | Format-Table -AutoSize | Out-String
# in a html mail embed $table inside '<pre>' tags, so
# it will display in a monospace font.
# $body = "<pre>$table</pre>"
}
else {
Write-Warning "Could not find $user"
}
Just import once, keep variable $data and repeat the part that starts with $user = ... for each new user
I was able to solve the issue using a combination of Foreach, an if statment and then switch.
$source = '\somesoure.csv'
$csv = import-csv $source
Foreach($row in $csv){
$personName = $row."Full Name"
$accessRequired = $row."Access Required"
if ($personName -eq $mayInputNameVariable){
//do some code stuff such as write to a column
switch ($accessRequired){
"System 1" {
$System1 = "Access Required: System 1`n"
}
//do it for all switch values
}
$emailBody = "Full Name:$personName`n" + $system1 + $system2 ...etc
$csv | Export-CSV $source -NoTypeInformation
Thanks folks!

Check if a value exists in one csv file and add static text to another csv field with Powershell

I need to check if the column value from the first csv file, exists in any of the three other csv files and return a value into a new csv file, in order of precedence.So if the username field from allStaff.csv exists in the list of usernames in the sessionVPNct.csv file, put the static text into the final csv file as 'VPN'. If it does not exist, check the next csv file: sessionCRXct.csv then put the static text 'CRX', if not check the last csv file: sessionTMSct.csv then put the static text: TM if not the put the static text 'none' into the final csv file.
I have four csv files as below:
1. allStaff.csv
2. VPN.csv
3. CRX.csv
4. TMS.csv
I have imported the csv files into variables as below:
$allUsers = Import-Csv -Path "C:\allStaff.csv"
$vpn = Import-Csv -Path "C:\VPN.csv" | Select-Object -ExpandProperty UserName
$crx = Import-Csv -Path "C:\CRX.csv" | Select-Object -ExpandProperty UserName
$tms = Import-Csv -Path "C:\TMS.csv" | Select-Object -ExpandProperty UserName
The $allUsers variable displays the following:
Firstname LastName Username Position Area
--------- -------- -------- -------- ----
Joe Bloggs jbloggs Gardener Maintenance
Jim Smith jsmith Accountant Finance
Bob Seger bseger HR Advisor Human Resources
Adam Boson aboson Customer Support IT
Adele bree abree Payroll Finance
The $vpn variable displays the following:
Username
--------
jbloggs
jsmith
The $crx variable displays the following:
Username
--------
jbloggs
jsmith
bseger
The $tms variable displays the following:
Username
--------
jbloggs
jsmith
bseger
aboson
Then I have the following line to start the result csv file
$result = $allUsers | Select-Object *,ConnectionMethod
Not quite sure how to do the final query, which I believe should be an if else loop to go through all rows in the $result variable, and check the other csv if the username field exists, then return the static text.
$result | Export-Csv -Path "C:\allStaffConnections.csv"
This is how I need the final allStaffConnections.csv file to be displayed.
Firstname LastName Username Position Area ConnectionMethod
--------- -------- -------- -------- ---- --------------
Joe Bloggs jbloggs Gardener Maintenance VPN
Jim Smith jsmith Accountant Finance VPN
Bob Seger bseger HR Advisor Human Resources CRX
Adam Boson aboson Customer Support IT TMS
Adele bree abree Payroll Finance none
Am I on the right track with the below code?
$allUsers = Import-Csv -Path "C:\allStaff.csv"
$vpn = Import-Csv -Path "C:\VPN.csv" | Select-Object -ExpandProperty UserName
$crx = Import-Csv -Path "C:\CRX.csv" | Select-Object -ExpandProperty UserName
$tms = Import-Csv -Path "C:\TMS.csv" | Select-Object -ExpandProperty UserName
$vpnText = 'VPN'
$crxText = 'CRX'
$txsText = 'TMS'
$noneText = 'none'
$allUsersExtended = $allUsers | Select-Object *,ConnectionMethod
$results = $allUsersExtended.ForEach(
{
if($vpn -Contains $PSItem.UserName) {
# add $vpnText to ConnectionMethod column for that row in the $result
$PSItem.ConnectionMethod = $vpnText
}elseif($crx -Contains $PSItem.UserName) {
# add $crxText to ConnectionMethod column for that row in the $result
$PSItem.ConnectionMethod = $crxText
}elseif($tms -Contains $PSItem.UserName) {
# add $txsText to ConnectionMethod column for that row in the $result
$PSItem.ConnectionMethod = $tmsText
}else {
# add $noneText to ConnectionMethod column for that row in the $result
$PSItem.ConnectionMethod = $noteText
}
})
$results | Export-Csv -Path "C:\allStaffConnections.csv" -NoTypeInformation
This gives me an empty allStaffConnections.csv file.
I have run the code line by line and can get as far as:
$allUsersExtended = $allUsers | Select-Object *,ConnectionMethod
Which gives me the extra column "ConnectionMethod", but after running the loop, it gives me an empty allStaffConnections.csv file.
here is one way to do the job. [grin] it presumes that you only want to 1st connection type found. if you want all of them [for instance, JBloggs has all 3 types listed], you will need to concatenate them.
what it does ...
fakes reading in the CSV files
when ready to use real data, comment out or remove the entire #region/#endregion section and use Get-Content.
iterates thru the main collection
uses a switch to test for membership in each connection type list
this breaks out of the switch when it finds a match since it presumes you only want the 1st match. if you want all of them, then you will need to accumulate them instead of breaking out of the switch block.
sets the $ConnectionType as appropriate
builds a PSCO with all the wanted props
this likely could be shortened by using Select-Object, a wildcard property selector, and a calculated property.
sends it out to the $Results collection
shows it on screen
saves it to a CSV file
the code ...
#region >>> fake reading in CSV files
# in real life, use Import-CSV
$AllUsers = #'
FirstName, LastName, UserName, Position, Area
Joe, Bloggs, jbloggs, Gardener, Maintenance
Jim, Smith, jsmith, Accountant, Finance
Bob, Seger, bseger, HR Advisor, Human Resources
Adam, Boson, aboson, Customer Support, IT
Adele, bree, abree, Payroll, Finance
'# | ConvertFrom-Csv
$Vpn = #'
UserName
jbloggs
jsmith
'# | ConvertFrom-Csv
$Crx = #'
UserName
jbloggs
jsmith
bseger
'# | ConvertFrom-Csv
$Tms = #'
UserName
jbloggs
jsmith
bseger
aboson
'# | ConvertFrom-Csv
#endregion >>> fake reading in CSV files
$Results = foreach ($AU_Item in $AllUsers)
{
# this presumes you want only the 1st connection type found
# if you want all of them, then you will need to concatenate them
switch ($AU_Item.UserName)
{
{$_ -in $Vpn.UserName}
{
$ConnectionType = 'VPN'
break
}
{$_ -in $Crx.UserName}
{
$ConnectionType = 'CRX'
break
}
{$_ -in $Tms.UserName}
{
$ConnectionType = 'TMS'
break
}
default
{
$ConnectionType = 'None'
}
}
[PSCustomObject]#{
FirstName = $AU_Item.FirstName
LastName = $AU_Item.LastName
UserName = $AU_Item.UserName
Position = $AU_Item.Position
Area = $AU_Item.Area
ConnectionTYpe = $ConnectionType
}
}
# on screen
$Results
# send to CSV
$Results |
Export-Csv -LiteralPath "$env:TEMP\brokencrow_-_UserConnectionType.csv" -NoTypeInformation
truncated on screen output ...
FirstName : Joe
LastName : Bloggs
UserName : jbloggs
Position : Gardener
Area : Maintenance
ConnectionTYpe : VPN
[*...snip...*]
FirstName : Adele
LastName : bree
UserName : abree
Position : Payroll
Area : Finance
ConnectionTYpe : None
the CSV file content from brokencrow_-_UserConnectionType.csv ...
"FirstName","LastName","UserName","Position","Area","ConnectionTYpe"
"Joe","Bloggs","jbloggs","Gardener","Maintenance","VPN"
"Jim","Smith","jsmith","Accountant","Finance","VPN"
"Bob","Seger","bseger","HR Advisor","Human Resources","CRX"
"Adam","Boson","aboson","Customer Support","IT","TMS"
"Adele","bree","abree","Payroll","Finance","None"

Return a selectable list in Powershell

I'm writing a powershell script that will search active directory and give me info on users like this:
$fname = Read-Host 'Enter first name'
$lname = Read-Host 'Enter Last Name'
$search = [adsisearcher]"(&(ObjectCategory=Person)(ObjectClass=User)(givenName=$fname)(sn=$lname))"
$users = $search.FindAll()
foreach($user in $users) {
$displayname = $user.Properties['displayname']
"$displayname"
}
That will return a list of users who have the same first and last names:
User1
User2
User3
User4
I'd then like to be able to select which user I want to show further info on, something like this:
Read-Host 'Enter user number'
#input 1 - 4
#returns exchange server name for the selected user:
$msExchHomeServerName = $user.Properties['msExchHomeServerName']
"Exchange server: $msExchHomeServerName"
I can't figure out how to return a selectable list that lets me get further details on that user.
This works for me. I'm more familiar with PSCustomObjects, but you could do this as a hashtable instead, I'm sure (although I think hashtables get funny if you try and use an integer as a key).
And I'm sorry, I'm too lazy to refactor this with ADSI, but hopefully the logic is clear.
If you wanted to, you could return the user properties you might need with your initial LDAP query and add them to the [PSCustomObject] you're creating for each user. Then just pull the properties out of $usertable rather than doing another AD query. (See the second example.)
However, I'm really adamant that if it's more than a few properties for more than a few users, don't try and grab everything at once. I get really sick of lazy LDAP filters with -properties * when you only want one property. In my environment, if I get all the properties on just my account, it's 74 KB. That starts to add up quickly when dragging stuff out of LDAP.
# sort user list by desired attribute below e.g. samaccountname, lastname, etc
$users = get-aduser -filter 'name -like "macdo*"' | sort samaccountname
# create an array to store the user results
$usertable = #()
$no = 0
$users | foreach {
$no++
$o = [PSCustomObject]#{
No = $no
Name = $_.samaccountname
}
$usertable += $o
}
$usertable |sort no
# this is what the table will look like on screen
No Name
-- ----
1 AKMacDonald
2 AMacDonald
3 BMacDonald
4 BMacdonnell
$myint = Read-Host 'Enter user number'
> Enter user number: 29
# Select desired user properties in Get-ADUser below
$ADuser = $usertable | where {$_.no -eq $myin} |select -ExpandProperty Name |
Get-Aduser -Properties msExchHomeServerName
$ADuser
#AD user output
DistinguishedName : CN=BMacDonald,OU=Accounts,DC=example,DC=com
Enabled : False
GivenName : Bruce
Name : BMacDonald
...
If you're grabbing a few extra attributes with your initial AD query, you can store them in the $usertable for quick retrieval.
# grab msExchHomeServerName in this query
$users = get-aduser -filter 'name -like "macdo*"' -properties msExchHomeServerName |
sort samaccountname
# create an array to store the user results
$usertable = #()
$no = 0
$users | foreach {
$no++
$o = [PSCustomObject]#{
No = $no
Name = $_.samaccountname
Exchsrv= $_.msExchHomeServerName
}
$usertable += $o
}
# do a "select" below if you don't want to display everything in $usertable
$usertable |sort no
# $usertable contents
No Name Exchsrv
-- ---- ----
1 AKMacDonald Exch1
2 AMacDonald Exch1
3 BMacDonald Exch2
4 BMacdonnell Exch3
$myint = Read-Host 'Enter user number'
> Enter user number: 29
# Select desired user properties from $usertable
$usertable | where {$_.no -eq $myint} | Select Name,Exchsrv
# output
Name Exchsrv
---- ----
AKMacDonald Exch1
You have to specify the properties that you'd like to load for each user. [adsisearcher] is a type accelerator for DirectorySearcher, so try this:
$filter = "(&(ObjectCategory=Person)(ObjectClass=User)(givenName=$fname)(sn=$lname))"
$propsToLoad = #('displayname', 'msExchHomeServerName')
$search = [System.DirectoryServices.DirectorySearcher]::new($filter, $propsToLoad)
If you want to avoid user selection error, you can use the PromptForChoice method :
$fname = (Read-Host 'Enter first name').Trim()
$lname = (Read-Host 'Enter Last Name').Trim()
$filter = "(&(samAccountType=805306368)(givenName=$fname)(sn=$lname))"
$propsToLoad = #('displayname','samaccountname', 'mail', 'l', 'department', 'msExchHomeServerName')
$search = [System.DirectoryServices.DirectorySearcher]::new($filter, $propsToLoad)
$results=$search.FindAll()
$results[$Host.UI.PromptForChoice( "Choose the namesake you want to see",`
"Type the corresponding SamAccountName", ($results | ForEach-Object `
{ New-Object System.Management.Automation.Host.ChoiceDescription( `
$_.Properties.samaccountname, $_.Properties.department) }), 0)].Properties.Values
This shows you this once you have typed givenName and surName :
Enter first name: Justine
Enter Last Name: Noix
Choose the namesake you want to see
Type the corresponding SamAccountName
[] JNoix [] JuNoix [?] Aide (la valeur par défaut est « JNoix ») : junoix
JuNoix
Justine Noix
LDAP://CN=Justine Noix,OU=R&D,OU=Tests,DC=someDomain,DC=adds
Justine.Noix.RD#someDomain.adds
R&D
SomeCity
mailserver.someDomain.adds
if you type a wrong samAccountName, it re-asks again.
if you don't care about any help or have no department setted in AD, simply replace the last line by :
$results[$Host.UI.PromptForChoice( "Choose the namesake you want to see",`
"Type the corresponding SamAccountName", ($results | ForEach-Object `
{ New-Object System.Management.Automation.Host.ChoiceDescription( `
$_.Properties.samaccountname, "") }), 0)].Properties.Values

Combining two commands into one and exporting to csv file in Powershell

Below is the code I'm using get data from the output of two commands, I then put them into two separate array's. When I combine the arrays the output looks how I would expect, but when I do select and try to output, it has gaps and not formatted correct. How get I get this to output nice to a csv file?
Example code:
$a = get-agentserver
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop #{
'Client Name' = ($_."Name" -Split '\.(?!\d)')[0]
'Policy Type' = $_."AgentServerType"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
}
} | Select "Client Name","Policy Type","Backup State","logon","account"
#$NewCSV
$l = foreach($i in $a.name){
get-definition -agentserver $i}
$l | convertto-csv | out-file t1.csv
$m = import-csv t1.csv | select agentserver,name,selectionsummary
$defcsv = $m | foreach-object{
new-object psobject -prop #{
'Policy Name' = $_.Name
'Backup Selection' = $_.selectionsummary
}
} | select "Policy Name","Backup Selection"
#$defcsv
$hope = $NewCSV + $defcsv
$hope2 = $hope | select "Client Name","Policy Name","Policy Type","Backup Selection"
$hope2
Ex output $hope(that look right to me)
Client Name : Name
Policy Type : Ndmp
Backup State : Unknown
logon : Succeeded
account : ndmp_user
Policy Name : Diff Bakcup
Backup Selection : COMMON, D: (Partial)
Ex output of $hope2(which is killing me how to fix)
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
Name Windows
Name Windows
Name Windows
Name Windows
Name Windows
Name Ndmp
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name \e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name\e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
Name Backup BLR_Pro... /root_vdm/IN-BLR400-FS-C...
I have cleaned up my code and tried to put my command outputs into one variable and iterate through it in one go, which looks much nicer, but the output result in the same as above in my $hope2 output. It is leaving a big gap under two of the header "Policy Name" and "Backup Selection". Is there a way to use regex to remove those particular spaces only under those two columns in Powershell?
This is the new code I am running using
$agentserver = get-agentserver
$agentserver | convertto-csv | select-object -skip 2 | out-file t2.csv
$agentserver = import-csv t2.csv -Header server,id,type,accountstate,logonaccount
$budefinition = foreach($i in $a.name){
get-backupdefinition -agentserver $i}
$budefinition | convertto-csv | out-file t1.csv
$converted_budef = import-csv t1.csv | select agentserver,name,selectionsummary
$a = $agentserver + $converted_budef
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop #{
'Client Name' = ($_."server" -Split '\.(?!\d)')[0]
'Policy Type' = $_."type"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
'Policy Name' = ($_.Name -replace ","," ")
'Backup Selection' = ($_.selectionsummary -replace ","," ")
}
} | Select "Client Name","Policy Name","Policy Type","Backup Selection"
$NewCSV
Example of what I am trying to accomplish would look like this, that I can then use the export-csv and have a nice csv doc.
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
NAME Diff Bakup Windows Common D
NAME Archive Ndmp /root_vdm/
After doing $NewCSV | fl I get a output of two separate list as shown below and I need them to all be in one. Any ideas how to fix it in my code above?
Client Name : Name
Policy Name :
Policy Type : Ndmp
Backup Selection :
Client Name :
Policy Name : Diff Bakcup
Policy Type :
Backup Selection : COMMON D: (Partial)