Search found 101 matches

by mtartaglia
Wed Jan 03, 2018 9:40 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

2018-01-03_12-37-39.png
2018-01-03_12-37-39.png (41.67 KiB) Viewed 1722 times
See attached image to see what I was going for. I did a few tests that created this data.

However, I agree with you about the the primary key should be more than just the ID field. I will work on that. Thanks again!

Mike
by mtartaglia
Wed Jan 03, 2018 7:57 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

I want it to update every record. I am only updating what is in the view. The view only shows entries for ENDTIME, ENDDATE and ENDSPACE(Free disk space) that are NULL. This is exactly what I need. The script is only meant to run twice a day. Once for the START switch and once for the END switch. I w...
by mtartaglia
Wed Jan 03, 2018 7:30 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

jvierra, I have tested inside and out and this code works now. It has been re-rewritten to fit my needs. For now, the primary key is just the IDNumber field. Thanks again. :D That will update all records for a server with the last update which is your issue. You still haven't defined a primary key. ...
by mtartaglia
Wed Jan 03, 2018 7:13 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

I took your advice and thought the process through the END switch again. Here is the code (just the end switch part) that now works 100% Please make any suggestions you see fit, but I wanted to at least post what I came up with so it may help others. Thanks for all your help. if ($end) { $creds = Ge...
by mtartaglia
Tue Jan 02, 2018 10:42 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

The process is
1. Search the view and select all rows with their ID field.
2. Take the list of ID's and modify each row with the respective EndDate, EndTime, and EndSpace.
by mtartaglia
Tue Jan 02, 2018 5:39 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

there can be more than one row with SystemName + DeviceID being the same. What about including the ID field with the systemane + DeviceID. Would that work or should I not add the ID field as you mentioned before?
by mtartaglia
Thu Dec 28, 2017 10:34 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

Oh I think I see where your confusion is. The PRIMARY KEY is the ID field in the image I sent. However, now that I looked at the database design I never assigned it to be the primary key. DOH! It is set as one now. The start block will happen at 12:01AM every morning and the end will happen at 11:59...
by mtartaglia
Thu Dec 28, 2017 9:42 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

table.png This is the table I am working with. As you can see I have an ID field (Which is the primary key). Here are the steps I am thinking of performing in order to update the the 'END' fields. NOTE: There is a SQ: view that shows all records that are NULL for the END fields as shown in the atta...
by mtartaglia
Thu Dec 28, 2017 7:16 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

I'll post it when its done.
by mtartaglia
Thu Dec 28, 2017 6:53 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 14453

Re: Trouble with multiple Device ID's (Local Hard drives)

We do have a field called 'ID' that is the primary key. I am not sure what you are trying to get at. The schema is fine for what I am doing, I am just having trouble coding it in powershell.

I will keep at it.

Thank you for your assistance. Greatly appreciated.