Search found 100 matches

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

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 miketartaglia
Wed Jan 03, 2018 7:30 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Wed Jan 03, 2018 7:13 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Tue Jan 02, 2018 10:42 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Tue Jan 02, 2018 5:39 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Thu Dec 28, 2017 10:34 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Thu Dec 28, 2017 9:42 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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 miketartaglia
Thu Dec 28, 2017 7:16 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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

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

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.
by miketartaglia
Thu Dec 28, 2017 6:27 am
Forum: PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 10435

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

Sorry for the lack of clarity. the START switch only enters start date, start time and current free space at that time on each local disk. This leave 3 fields set to NULL. Endate, EndTime and EndSpace (current free space at the time on each local disk. All the end switch is supposed to do and did do...