Quantcast
Channel: File Services and Storage forum
Viewing all articles
Browse latest Browse all 13565

File Server Resource Manager Variables and script

$
0
0

I am using the following settings within FSRM to run a PS script that will generate a pop-up to users.

The script runs successfully when using syntax: AfUserNotify-gen.ps1 DOMAIN/USERNAME

however FSRM fails to use the variable [Source Io Owner] when running and does not generate the csv file.

any ideas? see scripts below.

FSRM settings:

AFUserNotify-gen.ps1

param($strUser)
if(!(test-path notify.csv)){copy notify-template.csv notify.csv}


#----------------------------------------------------------------------------------------------------
# Test for modules and import if necessary
#----------------------------------------------------------------------------------------------------
$blnAD = $false
$blnFSRM = $false
$moduleList = Get-Module | select Name
foreach ($module in $moduleList) {
    if ($module -eq "ActiveDirectory") {
        $blnAD = $true
    }
}

if (!$blnAD) {
    Import-Module "ActiveDirectory"
}


#----------------------------------------------------------------------------------------------------
# Obtain user pc's from extensionattributes
#----------------------------------------------------------------------------------------------------

$strSimpleUser = ($strUser -split '\\')[1]
$User = get-aduser $strSimpleUser -properties *


$pc1 = ($user.extensionattribute1 -split ' ')[0]
$pc2 = ($user.extensionattribute2 -split ' ')[0]
$pc3 = ($user.extensionattribute3 -split ' ')[0]
$pc4 = ($user.extensionattribute4 -split ' ')[0]
$pc5 = ($user.extensionattribute5 -split ' ')[0]

$PCArray = @($pc1,$pc2,$pc3,$pc4,$pc5)

#----------------------------------------------------------------------------------------------------
# MAIN
#----------------------------------------------------------------------------------------------------

foreach($pc in $PCArray){
add-content notify.csv "$strsimpleuser,$pc"
}

notify.cmd

Powershell.exe set-executionpolicy remotesigned -File"C:\scripts\powershell\quotas\NewNotify\AFUserNotify-gen.ps1 %1"


NETCRAMMER


Viewing all articles
Browse latest Browse all 13565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>