I want to build a dashboard that can that can take two inputs for a $Server and $Folder then when you submit it, it does a Get-ACL -path \$server$folder and displays the returned data. This is what I have so far but the returned data in not really readable. I don’t know if there’s another way to do this.
Here is what i have. If i take away the out-string I get a different error.
Think you would be better outputting $secperm to a grid or a table it should then work fine…I am using a function to return folder sizes, and I output to a grid and it’s all good. I am sure this will fix your issue. Look on www.poshud.com for some examples of how to output your data to either a table or a grid.
You are doing some very bad things there using FT etc
Try this revised section .
This will throw a display error.
what it means is UD cannot handle the nested access permissions for the owner.
So once you can manipulate the results from the get-acl into a normal row/column arrangement , it wil display fine
Thanks so much for the help. I am really just learning how to program in powershell. What bad things am I doing? I want to know so I dont do it in the future
The main “bad thing” you are doing is using Format-table. This is really only ever useful if you are outputting your result to a powershell console. The resultant object you get $secperm is just a string which then means you are having to manipulate text (which is why you are doing the join). UD understands powershell objects (some exclusions apply )
First one just outputs limited data to the screen , it will be selective what it will show you
second one tells potentially what you what you can select from the object
Third one just selects some properties from the object
Fourth selects all possible things and pipes it to out-gridview
Using out-gridview helps you see what you are actually going to give to something that is relying on the result.
So in the case where you are wanting the information to be used later by a table, then out-gridview (ogv for short) is a good tool to see if you have selected things properly
I almost got it now. There just a weird formatting thing i cant figure out. The accesstostring that shows all the groups is not formatted at all. It is just one long line basically.
@psDevUK. Any idea how to get the accesstostring to show up on multiple lines and not like one long line. I just cant figure it out. I tried putting a foreach loop in the accesstostring but that doesn’t work either.
Hey @gerard off work today so trying not to be a keyboard warrior, but I cannot help not being on my computer…anyways just want to say thanks to @BritV8 for your input, some good advice shared there…so without trying your whole script, I had a similar problem, I got asked by a manager to record people visiting the SALES dashboard I created, I had the exact same problem, that the multiple text line file I was storing the visitors in would always display as one huge line, which made it very difficult to read. So to get each line of the text file output into it’s own line I did this:-
New-UDColumn -Size 12 -Endpoint {
New-UDHeading -Text "Welcome $user"
"$User logged in at $(get-date)" | Out-File "$Root\Visitors.txt" -Append
}
Dude don’t ever feel like that. I just spent an hour trying to figure out why invoke-item didn’t work in a grid button in IIS but worked fine running dashboard locally? So I used a modal and new-Udlink to achieve same result. But feel it took me way to long to think about that. Anyways I am back in the office tomorrow so will try your script. And if I can fix it will post my results back. Peace
Hi @gerard
Is this what you are looking for? I looped in every access and add Path as a property in output. This will work in Tables as well as in Grid.
thanks so much. that is basically it. the only other thing i was trying to do was only have the path show once but ill take this.
I was trying a loop on just the identity reference and file system rights and that just wasnt working.
i have to look up how this loop works but thank you again.
Great work @Abhijit , was just about to look at this now, but seen you chipped in a working solution whilst I was fast asleep…So @gerard someone else beat me too it, but great to see this community is thriving with help. Was going to mention a way to fix your PATH only showing once, but again @Abhijit has provided a working solution. I hope you learnt from this post and thanks for asking, as it sucks not knowing how to do something if all you need is a bit of guidence or a helpful solution which hopefully you will learn from and incorporate certain aspects of this into furture dashboards with the know-how you gained.