Forum

Posts by debell6701 (debell6701)

debell6701
debell6701
Posts: 5

I have users on the RDM free and I want to give them a datasource that has entries in it that I can setup as disabled. In other words I want the entries there but I dont want them to be able to open or connect to them.

Is there a way to do this?

3 mths How to disable folder or entry
debell6701
debell6701
Posts: 5

I hope this does complicate things even more but if you want a function that will import an excel document directly this is one I found about a year a go. In other words I didn't write this but have found it very useful.


function Import-Excel
{
param (
[string]$FileName,
[string]$WorksheetName,
[bool]$DisplayProgress = $true
)

if ($FileName -eq "") {
throw "Please provide path to the Excel file"
Exit
}

if (-not (Test-Path $FileName)) {
throw "Path '$FileName' does not exist."
exit
}

$FileName = Resolve-Path $FileName
$excel = New-Object -com "Excel.Application"
$excel.Visible = $false
$workbook = $excel.workbooks.open($FileName)

if (-not $WorksheetName) {
Write-Warning "Defaulting to the first worksheet in workbook."
$sheet = $workbook.ActiveSheet
} else {
$sheet = $workbook.Sheets.Item($WorksheetName)
}

if (-not $sheet)
{
throw "Unable to open worksheet $WorksheetName"
exit
}

$sheetName = $sheet.Name
$columns = $sheet.UsedRange.Columns.Count
$lines = $sheet.UsedRange.Rows.Count

Write-Warning "Worksheet $sheetName contains $columns columns and $lines lines of data"

$fields = @()

for ($column = 1; $column -le $columns; $column ++) {
$fieldName = $sheet.Cells.Item.Invoke(1, $column).Value2
if ($fieldName -eq $null) {
$fieldName = "Column" + $column.ToString()
}
$fields += $fieldName
}

$line = 2


for ($line = 2; $line -le $lines; $line ++) {
$values = New-Object object[] $columns
for ($column = 1; $column -le $columns; $column++) {
$values[$column - 1] = $sheet.Cells.Item.Invoke($line, $column).Value2
}

$row = New-Object psobject
$fields | foreach-object -begin {$i = 0} -process {
$row | Add-Member -MemberType noteproperty -Name $fields[$i] -Value $values[$i]; $i++
}
$row
$percents = [math]::round((($line/$lines) * 100), 0)
if ($DisplayProgress) {
Write-Progress -Activity:"Importing from Excel file $FileName" -Status:"Imported $line of total $lines lines ($percents%)" -PercentComplete:$percents
}
}
$workbook.Close()
$excel.Quit()
}

4 yrs Create sessions spreadsheet or delimited file?
debell6701
debell6701
Posts: 5

Is there a way I can set the way my RDP connectioons open per workstation? I have folks that prefer to have their RDP connections open full screen and others that prefer to have them open embeded. They are sharing the same datasource/connections.

4 yrs workstation specific settings
debell6701
debell6701
Posts: 5

is this doable with a Powershell(Remote). doesnt seem to have that option. Here is the actual script (obviously will be making changes to send the output to a variable.

Get-WmiObject Win32_service |Where-Object {$_.Startmode -eq "Auto" -and $_.startname -ne "NT AUTHORITY\LocalService" -and $_.startname -ne "LocalSystem" -and $_.startname -ne "NT Authority\NetworkService"}|Group-Object -Property StartName | Format-Table Name, Count -auto

The intent of this is get a list of some of the services from the remote PC and have it saved to the description

4 yrs how to update currently selected session
debell6701
debell6701
Posts: 5

I think this my be an easy question but I am just not seeing it. What I want to do is update the currently selected session.


In detail: I am running a script to produce a filtered list of services running on the remote server and I want to take the output which is assigned to variable and update the description field with it. I cant seem to figure out work with the current session (think it is just getting the session ID of the currently selected session)

4 yrs how to update currently selected session