Hello,
Its script which gather required information.
$SCCMSiteCode = 'DBP'
$list = get-content 'C:\Users\bb7638\Desktop\list.txt'
$pack= Get-WmiObject -ComputerName $SCCMServerName -Namespace root\sms\site_$SCCMSiteCode -Query "SELECT * FROM SMS_PackageStatusDistPointsSummarizer WHERE ServerNALPath like '%$DPName%'" | select packageID, SourceNALPath
}
It returned 2 column value:
packageID SourceNALPath
--------- -------------
DB200005 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DB200005\
DBC00384 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00384\
DBC003CC MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC003CC\
DBC003E7 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC003E7\
DBC003EB MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC003EB\
DBC00407 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00407\
DBC00711 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00711\
DBC007B7 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC007B7\
DBC007B8 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC007B8\
DBC007F4 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC007F4\
DBC00811 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00811\
DBC00820 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00820\
DBC00822 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00822\
DBC00827 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC00827\
DBP00003 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBP00003\
DBP0000D MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBP0000D\
DB20021A MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DB20021A\
DB200295 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DB200295\
DBC0003A MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC0003A\
DBC003E8 MSWNET:["SMS_SITE=EEA"]\\WX0809.DANSKENET.NET\SMSPKGE$\DBC003E8\
I would like to remove first 25 character from left and 35 from right. onSourceNALPath column.
That's should be done as Substring.
For example i made that it should cut from start with code :
($pack.SourceNALPath).substring(0,25)
but its returning output like this ( that i have removed?:
MSWNET:["SMS_SITE=DBP"]\\
MSWNET:["SMS_SITE=DBP"]\\
MSWNET:["SMS_SITE=DBP"]\\
MSWNET:["SMS_SITE=DBP"]\\
Is it possible modify easy in this line below removing SourceNALPath value first 25 characters and 30 from end:
$pack= Get-WmiObject -ComputerName $SCCMServerName -Namespace root\sms\site_$SCCMSiteCode -Query "SELECT * FROM SMS_PackageStatusDistPointsSummarizer WHERE ServerNALPath like '%$DPName%'" | select packageID, SourceNALPath
If someone have more expierence to understand this logic, please help :)